x11pygrid icon indicating copy to clipboard operation
x11pygrid copied to clipboard

How to change the default key-bindings

Open KhalidAHamad opened this issue 5 years ago • 3 comments

Hi, I am using a 65% keyboard with no number pad. How can I change the default key-bindings to use the regular numbers?

Thanks in advance!

KhalidAHamad avatar Apr 15 '20 14:04 KhalidAHamad

I would like to know too.

Thanks !

danielcr10 avatar May 28 '20 16:05 danielcr10

Ok found it after giving a look at the code. The bindings are "GTK constants". The constants can probably be found in the GTK code, i've just quickly found them online here : https://pageperso.lif.univ-mrs.fr/~edouard.thiel/ez-draw-gtk/demo4g.c (just use the various constants written in the same way than "KP_1" (KP = KeyPad), for example "Num_Lock", or "1", "a", ...).

So you have to edit the default configuration, for example to use CTRL + ALT + 1 (numeric characters) ... (edit your ~/.config/pygrid.json configuration file) :

  "keys": {
    "accelerator": "<Ctrl><Alt>",
    "commands": {
      "0": "maximize",
      "1": "bottomleft",
      "2": "bottom",
      "3": "bottomright",
      "4": "left",
      "5": "middle",
      "6": "right",
      "7": "topleft",
      "8": "top",
      "9": "topright",
      "Return": "cycle-monitor"
    }
  }

(the accelerator config has also to be changed : i have no idea what the default value <Ctrl><Mod1><Mod2> means ...

SR-G avatar Jun 06 '20 20:06 SR-G

Ok found it after giving a look at the code. The bindings are "GTK constants". The constants can probably be found in the GTK code, i've just quickly found them online here : https://pageperso.lif.univ-mrs.fr/~edouard.thiel/ez-draw-gtk/demo4g.c (just use the various constants written in the same way than "KP_1" (KP = KeyPad), for example "Num_Lock", or "1", "a", ...).

So you have to edit the default configuration, for example to use CTRL + ALT + 1 (numeric characters) ... (edit your ~/.config/pygrid.json configuration file) :

  "keys": {
    "accelerator": "<Ctrl><Alt>",
    "commands": {
      "0": "maximize",
      "1": "bottomleft",
      "2": "bottom",
      "3": "bottomright",
      "4": "left",
      "5": "middle",
      "6": "right",
      "7": "topleft",
      "8": "top",
      "9": "topright",
      "Return": "cycle-monitor"
    }
  }

(the accelerator config has also to be changed : i have no idea what the default value <Ctrl><Mod1><Mod2> means ...

Not working for me, i'd like to set this configuration: CTRL + SHIFT + character (on the left side of the keyboard, such as 'a', 's', 'd' ecc...). I tried your configuration but it seems to not recognise the input

Salvatore-tech avatar Aug 22 '20 20:08 Salvatore-tech