6

Trying to swap the Ctrl and Super keys around on a ubuntu box.

Have managed to swap Super and Ctrl around using xmodmap. Now i just need to change the stty intr to be Super_L + C

I can't for the life of me find the notation for the super key. (For example ^ is the control key)

Does anyone know what the notation is for super with stty? i'd like to be able to type

stty intr Super_L + C

For example.

Or some other even better way of making Super+C the interrupt

1 Answer 1

1

There is no notation for that.

In general, stty (and the OS components which use these settings) doesn't see keys as such – the terminal app translates those keys to a byte sequence and the tty layer only sees those translated bytes, and stty lets you se a specific byte which will make the tty layer trigger the interrupt signal.

In other words, the intr parameter is a single byte value corresponding to some symbol you can actually enter. (In the early Unix systems intr was set to the # sign.)

So when you set intr to ^C, that's just stty shorthand for byte 0x03 (compare: the letter C is 0x43 in ASCII). Basically both Shift and Ctrl just set and clear some bits of the 'base' byte. There's no such equivalent for Super, however.

As a result, most terminals merely ignore Super and send the base letter unmodified; some might send ANSI "escape" sequences (similar to those you get from arrow keys or function keys), but you couldn't use those with stty anyway because it still requires a single byte. You cannot bind the interrupt key to a multibyte sequence; it'd just pick up the first byte.

So the only thing you can do is somehow hack the terminal app itself to send a 0x03 byte when it receives the Super+C keypress. Some terminal emulators support this via generic "keyboard shortcuts", others might need actual source code patches.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .