Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
disable certain keyboard events
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Sat Mar 02, 2013 3:46 pm    Post subject: disable certain keyboard events Reply with quote

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
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Sat Mar 02, 2013 9:37 pm    Post subject: Reply with quote

I recently made my keyboards multimedia keys working, but you could remap any key. I found this wiki very useful:

http://en.gentoo-wiki.com/wiki/Multimedia_Keys
Back to top
View user's profile Send private message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Sat Mar 02, 2013 9:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sat Mar 02, 2013 10:16 pm    Post subject: Reply with quote

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
Code:
keycode  xx =

where xx is the keycode number. Than do
Code:
xmodmap ~/.Xmodmap

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
Code:
keycode xx =

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
View user's profile Send private message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Sun Mar 03, 2013 12:10 am    Post subject: Reply with quote

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
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Sun Mar 03, 2013 8:11 am    Post subject: Reply with quote

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
View user's profile Send private message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Sun Mar 03, 2013 9:41 pm    Post subject: Reply with quote

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 :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum