johnnovak / illwill

A curses inspired simple cross-platform console library for Nim
Do What The F*ck You Want To Public License
398 stars 27 forks source link

Question: how to get status of modifier keys? #22

Closed matkuki closed 2 years ago

matkuki commented 3 years ago

Hi.

Is there a way to get the status of Ctrl / Shift / Alt keys, without using getMouse procedure? getMouse only returns on a mouse event so it is not usable for key events. I'm trying to get combinations like Ctrl+Left/Right and Ctrl+Plus/Minus

Thanks

matkuki commented 3 years ago

Found that adding raw combinations to keySequences in line 570 can be used to add some combinations, but some combinations do not seem to register, like Ctrl+Plus/Minus. Any ideas?

johnnovak commented 3 years ago

I don't think that's possible in a cross platform way. I think we could just use a subset that is supported in *nix terminal emulators. So certain Ctrl+ sequences, but not all of them. Similarly to what terminal based program like Vim support.