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

How to handle Ctrl-Shift and arrows? #26

Closed codic12 closed 2 years ago

codic12 commented 3 years ago

Is it possible to handle sequences like Ctrl-Shift-LeftArrow, for instance? How are arrow keys in general handled, is it possible to do Ctrl-Left?

johnnovak commented 2 years ago

Control sequence like that are not supported in LInux/Unix terminals, hence they're not supported by illwill either.

codic12 commented 2 years ago

Text editors like micro can handle it, so I know that there is some way to do it. Not sure if it is nonstandard extension or not tho.

johnnovak commented 2 years ago

I don't know, but also bear in mind that the point of illwill is to support a common subset that works on on all supported platforms (Win, various Mac and Linux terminals). Supporting some esoteric extensions is not the goal here. But if you can solve it in a cross-platform way, sure, PRs are welcome :)

codic12 commented 2 years ago

It's worked on every terminal emulator I've tried, on Windows and Linux. I'll look into it.

johnnovak commented 2 years ago

You might be right, seems doable 🤷🏻 https://hellricer.github.io/2019/05/21/ctrl-arrows-in-terminal.html

Just try it on all three platforms and if it works, create a PR :)