i'm using an old laptop from 2013 still ok mainly a bit slow anyway i want to do some programming but... my main keyboard #9 key with the left parenthesis does not work anymore i can manage the 9 with the num keypad but as you all know writing programs we need the left parenthesis on a continual basis is there a way to map the main #9 key symbols to a function key say f9 for example either a solution from within ubuntu 20.04 or a small c program kinda like a TSR in ealier pc days. thanks
1 Answers
after fishing around here is my solution to my own question
9=18 6=15 8=17 f keys f6=72 f7=73 f8=74 f9=75
at https://dev.to/bitecode/remap-keys-in-the-keyboard-in-ubuntu-5a36 i found
xmodmap -pke > .Xmodmap open the .Xmodmap file and find key codes within for example keycode 38 = a A a A then change key codes for example
keycode 112 = Prior NoSymbol Prior keycode 117 = Next NoSymbol Next is changed to keycode 112 = KP_Left KP_4 KP_Left KP_4 keycode 117 = KP_Right KP_6 KP_Right KP_6 Now save the file,
in my case it was keycode 75 = 9 parenleft 4 dollar 9 parenleft 9 parenleft
**** then the info goes on to and activate the key map: with $ xmodmap .Xmodmap but this just freeze my computer !!
so ... i reboot and try something else
at How do I set Xmodmap on login?
i found near the bottom
xdg run scripts in ~/.config/autostart upon login in a X session. To load xmodmap config upon login, add the following script to ~/.config/autostart/xmodmap.desktop:
[Desktop Entry] Name[en_US]=Xmodmap Comment[en_US]=xmodmap ~/.Xmodmap Exec=/usr/bin/xmodmap .Xmodmap Icon=application-default-icon X-GNOME-Autostart-enabled=true Type=Application
Then logout and login again, and your Xmodmap configuration should've been loaded.
If it's not working, try to run xmodmap in terminal to see if it's xmodmap that complains:
$ xmodmap ~/.Xmodmap
so i did
$ mkdir ~/.config/autostart $ sudo nano ~/.config/autostart/xmodmap.desktop
put in the code above saved the file xmodmap.desktop checked with
$ cat ~/.config/autostart/xmodmap.desktop
and logout and login again
and it worked now i get a 9 with f9 key now i get a left parenthesis with shift-f9 key
((((((999999((((())))) with my f9 key great!!!
other maybe helpful References
https://medium.com/@saplos123456/persistent-keyboard-mapping-on-ubuntu-using-xmodmap-cd01ad828fcd
https://unix.stackexchange.com/questions/49650/how-to-get-keycodes-for-xmodmap
- 1