Advertisement
Guest User

xkb modify mousekey config

a guest
Jun 22nd, 2021
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.84 KB | None | 0 0
  1. // Interpretations for arrow keys and a bunch of
  2. // other common keysyms which make it possible to
  3. // bind "mouse" keys using xmodmap and activate or
  4. // deactivate them from the keyboard.
  5.  
  6. default partial xkb_compatibility "mousekeys" {
  7.  
  8.     // Keypad actions.
  9.     interpret.repeat= True;
  10.  
  11.     interpret KP_1 {
  12.     action = MovePtr(x=-1,y= +1);
  13.     };
  14.     interpret KP_End {
  15.     action = MovePtr(x=-1,y= +1);
  16.     };
  17.  
  18.     interpret KP_2 {
  19.     action = MovePtr(x=+0,y= +1);
  20.     };
  21.     interpret KP_Down {
  22.     action = MovePtr(x=+0,y= +1);
  23.     };
  24.  
  25.     interpret KP_3 {
  26.     action = MovePtr(x=+1,y=+1);
  27.     };
  28.     interpret KP_Next {
  29.     action = MovePtr(x=+1,y=+1);
  30.     };
  31.  
  32.     interpret KP_4 {
  33.     action = MovePtr(x=-1,y=+0);
  34.     };
  35.     interpret KP_Left {
  36.     action = MovePtr(x=-1,y=+0);
  37.     };
  38.  
  39.     interpret KP_6 {
  40.     action = MovePtr(x=+1,y=+0);
  41.     };
  42.     interpret KP_Right {
  43.     action = MovePtr(x=+1,y=+0);
  44.     };
  45.  
  46.     interpret KP_7 {
  47.     action = MovePtr(x=-1,y=-1);
  48.     };
  49.     interpret KP_Home {
  50.     action = MovePtr(x=-1,y=-1);
  51.     };
  52.  
  53.     interpret KP_8 {
  54.     action = MovePtr(x=+0,y=-1);
  55.     };
  56.     interpret KP_Up {
  57.     action = MovePtr(x=+0,y=-1);
  58.     };
  59.  
  60.     interpret KP_9 {
  61.     action = MovePtr(x=+1,y=-1);
  62.     };
  63.     interpret KP_Prior {
  64.     action = MovePtr(x=+1,y=-1);
  65.     };
  66.  
  67.     interpret KP_5 {
  68.     action = PointerButton(button=2);
  69.     };
  70.     interpret KP_Begin {
  71.     action = PointerButton(button=2);
  72.     };
  73.  
  74.     //interpret KP_F2 {
  75.     //action = SetPtrDflt(affect=defaultButton,button=1);
  76.     //};
  77.     //interpret KP_Divide {
  78.     //action = SetPtrDflt(affect=defaultButton,button=1);
  79.     //};
  80.  
  81. //    interpret KP_F3 {
  82. //  action = SetPtrDflt(affect=defaultButton,button=2);
  83. //    };
  84. //    interpret KP_Multiply {
  85. //  action = SetPtrDflt(affect=defaultButton,button=2);
  86. //    };
  87.     interpret KP_F4 {
  88.         action = PointerButton(button=4);
  89.     };
  90.     interpret KP_Subtract {
  91.         action = PointerButton(button=4);
  92.     };
  93.  
  94.     interpret KP_Separator {
  95.     action = PointerButton(button=5, count = 3);
  96.     //action = LockPointerButton(button=5, count = 3);
  97.  
  98.     };
  99.     interpret KP_Add {
  100.     action = PointerButton(button=5, count = 3);
  101.     //action = LockPointerButton(button=5, count = 3);
  102.  
  103.  
  104.     };
  105.  
  106.     interpret KP_0 {
  107.     action = pointerbutton(button=default);
  108.     };
  109.     interpret KP_Insert {
  110.     action = PointerButton(button=default);
  111.     };
  112.  
  113.     interpret KP_decimal {
  114.     action = PointerButton(button=3);
  115.     };
  116.     interpret KP_Delete {
  117.     action = PointerButton(button=3);
  118.     };
  119.  
  120.     // Additional mappings for Solaris keypad compatibility.
  121.  
  122.     interpret F25 { // aka KP_Divide
  123.     action = SetPtrDflt(affect=defaultButton,button=1);
  124.     };
  125.     interpret F26 { // aka KP_Multiply
  126.     action = SetPtrDflt(affect=defaultButton,button=2);
  127.     };
  128.     interpret F27 { // aka KP_Home
  129.     action = MovePtr(x=-1,y=-1);
  130.     };
  131.     interpret F29 { // aka KP_Prior
  132.     action = MovePtr(x=+1,y=-1);
  133.     };
  134.     interpret F31 { // aka KP_Begin
  135.     action = PointerButton(button=default);
  136.     };
  137.     interpret F33 { // aka KP_End
  138.     action = MovePtr(x=-1,y= +1);
  139.     };
  140.     interpret F35 { // aka KP_Next
  141.     action = MovePtr(x=+1,y=+1);
  142.     };
  143.  
  144.     interpret.repeat= False;
  145.  
  146.     // New keysym actions.
  147.  
  148.     interpret Pointer_Button_Dflt {
  149.     action= PointerButton(button=default);
  150.     };
  151.     interpret Pointer_Button1 {
  152.     action= PointerButton(button=1);
  153.     };
  154.     interpret Pointer_Button2 {
  155.     action= PointerButton(button=2);
  156.     };
  157.     interpret Pointer_Button3 {
  158.     action= PointerButton(button=3);
  159.     };
  160.     interpret Pointer_Button4 {
  161.     action= PointerButton(button=4);
  162.     };
  163.     interpret Pointer_Button5 {
  164.     action= PointerButton(button=5);
  165.     };
  166.  
  167.     interpret Pointer_DblClick_Dflt {
  168.     action= PointerButton(button=default,count=2);
  169.     };
  170.     interpret Pointer_DblClick1 {
  171.     action= PointerButton(button=1,count=2);
  172.     };
  173.     interpret Pointer_DblClick2 {
  174.     action= PointerButton(button=2,count=2);
  175.     };
  176.     interpret Pointer_DblClick3 {
  177.     action= PointerButton(button=3,count=2);
  178.     };
  179.     interpret Pointer_Drag_Dflt {
  180.     action= LockPointerButton(button=default);
  181.     };
  182.     interpret Pointer_Drag1 {
  183.     action= LockPointerButton(button=1);
  184.     };
  185.     interpret Pointer_Drag2 {
  186.     action= LockPointerButton(button=2);
  187.     };
  188.     interpret Pointer_Drag3 {
  189.     action= LockPointerButton(button=3);
  190.     };
  191.  
  192.     interpret Pointer_EnableKeys {
  193.     action= LockControls(controls=MouseKeys);
  194.     };
  195.     interpret Pointer_Accelerate {
  196.     action= LockControls(controls=MouseKeysAccel);
  197.     };
  198.     interpret Pointer_DfltBtnNext {
  199.     action= SetPtrDflt(affect=defaultButton,button= +1);
  200.     };
  201.     interpret Pointer_DfltBtnPrev {
  202.     action= SetPtrDflt(affect=defaultButton,button= -1);
  203.     };
  204.  
  205.     // Allow an indicator for MouseKeys.
  206.     indicator "Mouse Keys" {
  207.         //!allowExplicit;
  208.     indicatorDrivesKeyboard;
  209.     controls= MouseKeys;
  210.     };
  211. };
  212.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement