Page 1 of 1
Kbd Question
Posted: Thu Apr 24, 2003 9:58 am
by Mastermind
I've been crawling all over the web but I couldn't find the answer to this question:
How do you intercept multiple key-presses like [CTRL]+[ALT]+[DEL]?
Please help me...
Re:Kbd Question
Posted: Thu Apr 24, 2003 10:29 am
by Curufir
By keeping track of up/down state for all keys in question.
Re:Kbd Question
Posted: Thu Apr 24, 2003 12:57 pm
by slacker
you can do this by checking whether the break code for ctrl or alt has been read from 0x60
Re:Kbd Question
Posted: Fri Apr 25, 2003 12:53 am
by distantvoices
I have several status integers. Maybe this can be done by setting a bit in a Char-field via | and deleting it via &~. I have the kbd-read function then crawl through the list of typed keys, activate the proper fields uon keypress and scan the list of possibilities - a huge if then else construction which is really clumsy - and afterwards do what is due.
And when there is ctrl-alt-del - all the three pressed at one time - then a condition becomes true, and an action will be triggered. this I want to be flexible configured: reset, shutdown or ignore. the kernel would have to fetch some config file to set this feature and before that, ctrl-alt-del is simply ignored by default.
Re:Kbd Question
Posted: Sat Apr 26, 2003 10:40 am
by Slasher
A simpler method is to use a buffer.
declare a buffer in memory
char KEYS_PRESSED[104];
then in your keyboard interrupt handler
get the scan code SCAN
set KEY_PRESSED[SCAN] to 1 on MAKE CODES and 0
on BREAK CODES
in your code you can then issue
define your constants for all scan codes for each key
#define KEY_ESC 1
....
.....
if(KEY_PRESSES[KEY_CTRL]&&[KEY_ALT]&&[KEY_DEL])
......
hope this helps.