P
P
programmer01012019-07-08 16:50:45
linux
programmer0101, 2019-07-08 16:50:45

How to remap keys normally?

Created an Xmodmap file in the user's directory.
Wrote keycode 24 = KP_Multiply
running xmodmap Xmodmap
no error messages, the program accepted the commands properly, and could show if the file was compiled incorrectly.
It should write an asterisk on q when laying out Russian and English, but it writes q.
The problem is that it is dibilism to assign key codes to caseims, you need caseims to caseims.
So that in English, q was an asterisk, and in Russian a plus.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2019-07-09
@CityCat4

This is not done through Xmodmap, it is necessary to hack the layout file in /usr/share/X11/xkb/symbols.
Here is how, for example, I change the actions when pressing the "gray" Enter to the normal Enter action (figly's habit)

--- keypad.old  2017-03-26 22:34:14.000000000 +0700
+++ keypad      2017-11-13 15:43:17.528523496 +0700
@@ -14,7 +14,7 @@
     key  <KP1> {       [  KP_End,      KP_1    ]       };
     key  <KP2> {       [  KP_Down,     KP_2    ]       };
     key  <KP3> {       [  KP_Next,     KP_3    ]       };
-    key <KPEN> {       [       KP_Enter        ]       };
+    key <KPEN> {       [       Return          ]       };
     key <KPEQ> {       [       KP_Equal        ]       };
 
     key  <KP0> {       [  KP_Insert,   KP_0    ]       };

The layout file lists, separated by commas, the codes that are generated in different groups.
man xkbcomp
man setxkbmap

P
polar_yogi, 2019-07-10
@polar_yogi

You can see the current mapping:
For keycode 24, it shows for me:
correspondingly
gives * in English layout and + in Russian.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question