I understand that stty intr ^C
(which is also the default) sets CTRL+C to send an interrupt to a process.
I would like to understand how to send other combinations that are not only CTRL plus a key (e.g. ALT+C).
In particular, I have a Mac keyboard and I used GNOME Tweaks to `Swap Left Win with Left Ctrl', and I'd like to map my physical key 'control' (which should now be remapped to 'command') and C to send an interrupt.
I repeat in case it's confusing. I'd like to press 'control' and C on my keyboard to send an interrupt while the two keys are swapped (as I want them). I simply want to follow the Mac standard to keep switching in my mind.
If I use showkey I get the following:
> showkey
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]
press any key (program terminates 10s after last keypress)...
keycode 28 release
ckeycode 46 press (here I've pressed the key 'C')
keycode 46 release
keycode 125 press (here I've pressed the key 'command', remapped to 'control' with GNOME Tweaks)
keycode 125 release
keycode 29 press (here I've pressed the key 'control', remapped to 'command' with GNOME Tweaks)
keycode 29 release
I'd like to press keycode 29 and keycode 46 to send SIGINT.
Thank you.