0

How to disable keys from the keyboard?

i want to disable a key and my question is beeing aswered in the linked thread. however i have an additinal question:

is there a way to findout the keycode of a specific key in ubuntu 17.10?

1 Answers1

2

Yeah, xev should do the trick. If I'm remembering right you can find it in the x11-utils package. Run xev and press the keys you want, it'll spit out a bunch of info for each event:

Example of xev output

For just keyboard events, you should launch it in a terminal with xev -event keyboard to tell it to ignore non-keyboard events like mouse moves.

  • Don't you mean xev -event keyboard? – luk3yx Apr 22 '18 at 22:25
  • Oddly enough it seems like both work just fine. But yeah, man page refers to -event. – Different55 Apr 22 '18 at 22:26
  • xev -e seems to also work, perhaps xev just checks the first letter. – luk3yx Apr 22 '18 at 22:28
  • the answer also seems to be answered in the linked thread. guess i need to sleep. however it does not work i want to find the keycode for FN+f10. i dont need to press FN because its being pressed automaticly(uefi). – hanswurst31 Apr 22 '18 at 22:30
  • 1
    [code]KeymapNotify event, serial 28, synthetic NO, window 0x0, keys: 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    KeymapNotify event, serial 28, synthetic NO, window 0x0, keys: 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [/code]

    – hanswurst31 Apr 22 '18 at 22:31
  • 1
    @hanswurst31 In that case you should try the answer at https://askubuntu.com/a/827953/495653 and see if that works. Most FN-based keypresses aren't treated as normal keypresses. – luk3yx Apr 22 '18 at 22:34