0

I am using Ubuntu 18.04.

I ran the code xev -event keyboard on my terminal, after that I entered code xmodmap -e 'keycode 113=' ; but my up arrow key was not disabled as I expected.

I repeated the same procedure for the other key(down arrow key) but this time I changed the 113 to 116 hoping to disable the down arrow key but it was not disabled.

enter image description here

Lorenz Keel
  • 8,905
MrLaw
  • 1
  • 3
  • Until you get it configured, pit a piece of scotch tape on each keycap you want to nullify. The texture will teach you to stop touching them quickly. – K7AAY Oct 25 '19 at 04:26

1 Answers1

1

Example:

xev -event keyboard

a line from above command output for Up Arrow key
state 0x10, keycode 111 (keysym 0xff52, Up), same_screen YES,

a line from above command output for Down Arrow key
state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES,

Run below commands

$ xmodmap -e "keycode 111 = "
$ xmodmap -e "keycode 116 = "
$ 

Check with below commands

$ xmodmap -pke | grep Up
keycode  80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8
keycode 151 = XF86WakeUp NoSymbol XF86WakeUp NoSymbol XF86WakeUp
keycode 185 = XF86ScrollUp NoSymbol XF86ScrollUp NoSymbol XF86ScrollUp
keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp
keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp
$ xmodmap -pke | grep Down
keycode  88 = KP_Down KP_2 KP_Down KP_2 KP_Down KP_2
keycode 186 = XF86ScrollDown NoSymbol XF86ScrollDown NoSymbol XF86ScrollDown
keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown
keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown
$ 

xev -event keyboard result

KeyRelease event, serial 28, synthetic NO, window 0x3000001,
    root 0x105, subw 0x0, time 396765, (1224,931), root:(1274,1011),
    state 0x10, keycode 111 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x3000001,
    root 0x105, subw 0x0, time 397693, (1224,931), root:(1274,1011),
    state 0x10, keycode 116 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False
PRATAP
  • 22,460
  • The up and down arrow keys of my system is faulty and keep pressing, can this prevent the code xev -event keyboard and state 0x10, keycode 111 (keysym 0xff52, Up), same_screen YES from running well? – MrLaw Oct 25 '19 at 04:57
  • In that case, Just run xmodmp -pke | grep Up to know the keycode. same way for Down also.. then xmodmap -e "keycode $UpValue = " same way xmodmap -e "keycode $DownValue = " – PRATAP Oct 25 '19 at 06:47
  • Is there a permanent solution for this? This method works, until restarting – Mart Jun 08 '22 at 10:04
  • https://askubuntu.com/questions/333897/how-to-apply-xmodmap-permanently can you try this? – PRATAP Jun 08 '22 at 10:47