Sublime Forum

Copy, Paste etc. hardware keys do not work (KDE key binding issue ?)

#1

I have a keyboard with hardware Copy, Paste etc buttons.
In KDE, I have these set as “standard shortcuts” (System Settings, Standard shortcuts, Alternate) to the copy action.

This works everywhere, but not in Sublime - nothing happens.

If I remap them (System Settings, Custom shortcuts) instead to “ctrl+c” then it doesn’t help, though they continue to work OK e.g. in Kate as expected.

It is exactly like key codes are not arriving in Sublime.

I do not see extra keys like these listed on https://www.sublimetext.com/docs/3/key_bindings.html either

0 Likes

#2

if you type sublime.log_input(True) in the ST console (View menu -> Show Console), then press those keys in ST, does anything appear in the console?

0 Likes

#3

Thanks for the quick reply.

No, no output for the special keys, but typing “rew” outputs

chr evt: r (0x72)
chr evt: e (0x65)
chr evt: w (0x77)

Still in the mode where the hardware is map’d to a a custom shortcut of “ctrl+c”. Unmapped keys e.g. “props” do not register either.

It’s a Sun Type 7 USB keyboard, for others searching.

0 Likes

#4

What keys does xev log for those?

0 Likes

#5
KeyPress event, serial 40, synthetic YES, window 0x8200001,
    root 0x140, subw 0x0, time 0, (0,0), root:(0,0),
    state 0x4, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (18) "▒"
    XmbLookupString gives 1 bytes: (18) "▒"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic YES, window 0x8200001,
    root 0x140, subw 0x0, time 0, (0,0), root:(0,0),
    state 0x4, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (18) "▒"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x8200001,
    root 0x140, subw 0x0, time 19726563, (35,79), root:(3529,349),
    state 0x10, keycode 145 (keysym 0x1008ff58, XF86Cut), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

As you can see, the device is sending XF86Cut fine. FireFox etc are all happily using them.

0 Likes

#6

I’ve created an issue for this: https://github.com/sublimehq/sublime_text/issues/3617

0 Likes