Author Topic: Is there a way to make the Numpad Arrows work with shift on the Logitech K780 ke  (Read 1293 times)

0 Members and 1 Guest are viewing this topic.

Offline psygo

  • Thread Starter
  • Posts: 2
I love the K780, however it still has to improve a lot of things in order to get close to the perfect keyboard. Probably the thing that annoys me the most is those annoyingly shaped standard arrows, so I would like to use the Numpad Arrows instead. But, if you use the Shift + Arrow combination to highlight something, it simply doesn't work, at least not on my configurations: I use Ubuntu 18.04 right now --- does it work on Windows? (I will create a Windows VM later to see if it works, but does the key go through Ubuntu before reaching the VM?)

So... is there a way to fix this on Ubuntu? Maybe I could preconfirue it on a Windows machine and then switch back to Ubuntu?

Offline Tom_Kazansky

  • Posts: 290
  • Location: Vietnam
  • Oblivion Knight
have you tried hold both shift?

in Window, Shift + Shift + (numpad) Arrows should highlight stuffs.
"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke


Online Findecanor

  • Posts: 4306
  • Location: Stockholm, Sweden
  • Dans öl tarvö... "Pöngö"
The numeric keypad has different internal codes from the normal arrow keys, so it is up to each piece of software whether it treats them the same as arrows keys or not.

You could alter the keymap under X11 using the "xmodmap" program.
Run "xmodmap -pk | grep KP_" to find which keys have codes that start with "KP_", and then write a script that runs xmodmap to change those to use the non-prefixed symbols.
Now, this would of course work for Windows programs in a VM only if your VM takes its input from X11.

For a hardware solution, Hasu's USB to USB keyboard converter might work, but I'd think more complex to program.

Offline psygo

  • Thread Starter
  • Posts: 2
Thanks for the tips! Very useful. I did manage to change them, but not in the way I think would be best. Now they only act as arrow keys, not really a numpad. If I maintained their original assignments but only unprefixed them, every time I would hold Shift and press them, Shift would act exactly like NumLock.

In the end I followed this AskUbuntu answer besides yours: https://askubuntu.com/questions/24916/how-do-i-remap-certain-keys-or-devices

First, I used
Code: [Select]
xmodmap -pke | grep KP_ to list the keys. That showed many weird assignments, in my opinion, e.g.:
Code: [Select]
keycode  80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8 KP_Up KP_8. Why so many repetitions?

Now, since I only needed the arrows, I used this to modifiy the numpad 4, 8, 2 and 6 keys:

Code: [Select]
xmodmap -e "keycode  83 = Left"  # 4
xmodmap -e "keycode  80 = Up"    # 8
xmodmap -e "keycode  88 = Down"  # 2
xmodmap -e "keycode  85 = Right" # 6

Online Findecanor

  • Posts: 4306
  • Location: Stockholm, Sweden
  • Dans öl tarvö... "Pöngö"
Now they only act as arrow keys, not really a numpad.
Why so many repetitions?
Each position is with a different combination of modifiers and/or Num Lock.

I'm not sure what defines the order: you would have to read the man page.