LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-23-2010, 10:24 AM   #1
VaBeekeeper
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Rep: Reputation: 0
Possible to Spoof Keyboard or Mouse Hardware Interrupt with Software?


My multiple posts in various forums (for instance, see http://www.linuxquestions.org/questi...m7250n-782813/) turned up nothing on the question of how to get my HP Media Center desktop (ASUS P5LP motherboard) to avoid hanging after a period of inactivity. So I'm wondering whether it might be possible to write a C program that every once in a while effectively fools the OS into believing that a keyboard or mouse interrupt has occurred. That way, I can achieve my goal of being able to leave the computer for long periods of time without finding it hung up on my return.

If possible, generation of such an interrupt would be contingent on a certain amount of time having passed since the last interrupt (real or faked) occurred, and the generated event would be innocuous, such as notification that the mouse has moved (0,0) relative to its previous position, or that the <Shift> key was depressed and then released.

I guess I'm thinking of something along the lines of:


Code:
void onPeriodic(){
   if (timeInSecSinceLastInputPeripheralActivity() > MAX_INACTIVITY_SECS)
      spoofInputPeripheralActivity();  /* Avoid ACPI suspend */
}
Is it possible to do this (or something like this, that has the desired effect of avoiding suspend) in software?

Sorry for my ignorance on ACPI, Linux interrupts, &cet.
 
Old 01-25-2010, 04:27 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
This sort of behaviour is normally managed through your distro's "System Setup". "Control Centre", or just the battery icon on your desktop. Mine is just called "Power Manager"

Mine says "Mains Powered: When the system is idle for more than xx minutes.... Do Nothing", so I do not get the behaviour you describe.

There are other options, for example "What to do when running on battery and the battery is almost flat?" (Shutdown gracefully).

Try a search on your_distro power manager
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install hangs on hardware probe, still no mouse or keyboard LarryFrigginWachs Linux - Newbie 0 07-23-2007 07:26 PM
hardware problem: mouse/keyboard stop working airswit Linux - Hardware 10 06-01-2007 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration