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...
Kbd Question
Re:Kbd Question
you can do this by checking whether the break code for ctrl or alt has been read from 0x60
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Kbd Question
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.
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.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
Re:Kbd Question
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.
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.