B
B
BelBES2017-01-16 01:06:32
System administration
BelBES, 2017-01-16 01:06:32

How to disable keyboard except for some keys in Ubuntu?

Hello.
The following problem arose: it is necessary in Ubuntu 16.04 at runtime to be able to turn off the keyboard (with the exception of a few individual keys) and turn it back on.
Tried two ways:
1)
- Disable the keyboard: $ xinput float %id (where %id is the keyboard code "AT Translated Set 2 keyboard" from $ xinput list)
- Bind the necessary buttons: $ xmodmap -e 'keycode code = ACTION'
But apparently the first command turns off the keyboard tightly, so the subsequent ones have no effect. Incl. in fact we have: the keyboard is turned off, but some of the buttons cannot be turned back on.
2) I tried to create two configs for xmodmap: one with default button bindings, in the second, NoSymbol is set for all buttons except the necessary ones. In general, it works, but because there is a need to switch between these configs in runtime, then it is annoying that xmodmap picks up a new config with a delay of several seconds. As a result - inconvenience in use.
Does anyone know how to solve this problem correctly? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kpa6uu, 2017-01-16
@kpa6uu

Pry out the disabled buttons!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question