Numpad key repeating continuously [duplicate]
Solution 1:
Try this in a bash
script file:
#!/bin/bash
xinput test 11 |
while read pkc
do
if [[ "$pkc" =~ "key press 38" ]]
then
xmodmap -e 'keycode 38 = ';
sleep 0.5;
xmodmap -e 'keycode 38 = a A';
fi
done
-
Change the number
11
inxinput test 11
to your keyboard device number. You can find this number by runningxinput list
. You might need to check if theid
number is the right one for your keyboard. To do that choose the keyboardid
numbers withslave keyboard
in-front of them then check theid
in the terminal by runningxinput test id_number
and press the a on your keyboard. If you get an output likekey press 38
then this is the correctid
number for your current keyboard and if no output, continue testing the otherid
numbers until you see output. -
Change the nuber
38
in"key press 38"
andxmodmap -e 'keycode 38 = ';
andxmodmap -e 'keycode 38 = a A';
to the key code of the a key. You can find this number by runningxev
and pressing the a key. -
Change the number
0.5
insleep 0.5;
to the desired period in seconds for the a key to be disabled.
Steps to creating and using the script file:
- Create and open the file in an editor by running the following command in the terminal:
nano ~/no_aa.sh
-
Copy and paste the above code ( after modifying it ) into the editor.
-
Save the script file and exit the editor by pressing Ctrl + X then press Y.
-
Make the script file executable by running the following command in the terminal:
chmod +x ~/no_aa.sh
- Run the script by running the following command in the terminal:
bash ~/no_aa.sh
- Keep the terminal open and test the a key in other applications like writing in the LibreOffice writer.