Menu

Disable a keyboard key in Linux (Ubuntu)

1. Tìm keycode (ví dụ keycode của Alt L):
$ xev -event keyboard

KeyRelease event, serial 28, synthetic NO, window 0x6800001, root 0xf4, subw 0x0, time 6683862, (14,-13), root:(79,39), state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
hoặc 
$ xmodmap -pke | grep Alt
keycode  64 = Alt_L Meta_L Alt_L Meta_L
keycode 108 = Alt_R Meta_R Alt_R Meta_R
keycode 204 = NoSymbol Alt_L NoSymbol Alt_L
ta thấy keycode của Alt L là 64
2. Disable keycode:
$ xmodmap -e 'keycode 64='
3. Enable keycode:

$ xmodmap -e 'keycode 64=Alt_L'


What I would try:
  1. Connect a USB keyboard in there, or get into the machine using ssh.
  2. Open a terminal, and run xev -event keyboard. It will show some stuff on screen. If you omit the arguments, you will notice that it will show some more stuff if you move your mouse, as well.
  3. Then, press the key combination you want to disable [é]. The info in the screen will change, and you will have to look for the keycode value.
  4. Run something like this, changing <value> for the value you got for the keycode in the last step:
    xmodmap -e 'keycode <value>='
    
    For example, if I want to disable the ~ key ( Shift + ` ), I would have to run:
    xmodmap -e 'keycode 49='
    
I have only tried this with more standard keys, like Caps Lock... but I guess it should work with this as well. I hope this helps!

1 nhận xét :

  1. Myworld: Disable A Keyboard Key In Linux (Ubuntu) >>>>> Download Now

    >>>>> Download Full

    Myworld: Disable A Keyboard Key In Linux (Ubuntu) >>>>> Download LINK

    >>>>> Download Now

    Myworld: Disable A Keyboard Key In Linux (Ubuntu) >>>>> Download Full

    >>>>> Download LINK h6

    Trả lờiXóa