View previous topic :: View next topic |
Author |
Message |
skunk l33t
Joined: 28 May 2003 Posts: 646 Location: granada, spain
|
Posted: Sat Mar 02, 2013 3:46 pm Post subject: disable certain keyboard events |
|
|
hi!
sice a very long time i'm having an issue with dpms on a crappy msi laptop: the display backlight turns off just for a very short time then it turns back on.
it turns out it's caused by some keyboard events trigged when the backlight turns off, so when i execute:
Code: | xset dpms force off | i get the following key events:
Code: | # showkey
kb mode was RAW
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]
press any key (program terminates 10s after last keypress)...
keycode 224 press
keycode 224 release
keycode 225 press
keycode 225 release |
is there a way to disable these key events completely?
thank you. |
|
Back to top |
|
|
lost+found Guru
Joined: 15 Nov 2004 Posts: 509 Location: North~Sea~Coa~s~~t~~~
|
|
Back to top |
|
|
skunk l33t
Joined: 28 May 2003 Posts: 646 Location: granada, spain
|
Posted: Sat Mar 02, 2013 9:45 pm Post subject: |
|
|
i don't need to remap these keys, what i need is to get rid of any key event trigged by the turn off of the display backlight...
thank you anyway. |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Sat Mar 02, 2013 10:16 pm Post subject: |
|
|
Do not confuse the keymap in virtuals characters terminals including the console and the keymap under X. Both are independant. xset is an Xorg command and showkey is a command who allow to see kernel keymap who is the one who is used in the console.
I you want to disable a key under X, use the command xev to see what is the keycode of that key and create an ~/.Xmodmap file if not with the corresponding line
where xx is the keycode number. Than do
to apply .Xmodmap to the Xorg keymap. You can load .Xmodmap at X startup.
For the kernel keymap, use the showkey command to see the corresponding keycode of a key. Create a file named for example personal.map and write a line
where xx is the keycode number. Than use the command
Code: | loadkeys -u /path/to/personal.map |
to apply the keycode value to the kernel keymap. The -u option is for Unicode keyboard mode. That can be done at boot time.
Note that some keys are only detected by the BIOS and are impossible to remap or disable by Linux and Xorg. Some others need to have their scancode associate to a keycode in the kernel side to be remapped or disabled. Without a keycode associate to the scancode of a key no character can be associate to that key in the kernel and the key is not detected by Xorg. _________________ Paul
Last edited by Logicien on Sun Mar 03, 2013 2:21 am; edited 2 times in total |
|
Back to top |
|
|
skunk l33t
Joined: 28 May 2003 Posts: 646 Location: granada, spain
|
Posted: Sun Mar 03, 2013 12:10 am Post subject: |
|
|
thank you paul, x keycodes are 101 and 212, unfotunately disabling them doesn't work with xmodmap nor with loadkeys with the kernel keycodes.
the only workaround i found is to disable the keybord, turn backlight off and enable the keyboard again:
Code: | xinput set-prop 7 "Device Enabled" 0; xset dpms force off; xinput set-prop 7 "Device Enabled" 1 |
any idea how to integrate this into the display power management? |
|
Back to top |
|
|
lost+found Guru
Joined: 15 Nov 2004 Posts: 509 Location: North~Sea~Coa~s~~t~~~
|
Posted: Sun Mar 03, 2013 8:11 am Post subject: |
|
|
Does syslog show anything? ACPI events are logged there normally. The acpi events trigger predefined actions. If you haven't made these settings yourself, then it's a package like laptop-mode-tools handling these events. Are there any events/scripts under /etc/acpi except "default"? |
|
Back to top |
|
|
skunk l33t
Joined: 28 May 2003 Posts: 646 Location: granada, spain
|
Posted: Sun Mar 03, 2013 9:41 pm Post subject: |
|
|
lost+found wrote: | Does syslog show anything? |
no
Quote: | ACPI events are logged there normally. The acpi events trigger predefined actions. If you haven't made these settings yourself, then it's a package like laptop-mode-tools handling these events. Are there any events/scripts under /etc/acpi except "default"? |
acpi configuration was not touched and laptop-mode-tools was never installed.
anyway, this morning the hard disk has died, so i've decided to finally replace this 5 years old crap with a new laptop |
|
Back to top |
|
|
|