How to get Ctrl, Shift or Alt with getch() ncurses?

后端 未结 7 1439
挽巷
挽巷 2020-12-10 03:11

How to get Ctrl, Shift or Alt with getch() ncurses ?
I cannot get it work to get Ctrl, Shift or

7条回答
  •  执念已碎
    2020-12-10 03:36

    I know this is old, but for anyone still looking... You CAN do this on Windows (At least on my version). Simply interpret getch as bytes-like integer then as a string.

    str(getchvariablehere)
    

    For example, Ctrl+A is 1 on my keyboard. Its a bit tedious, but you can check any combo with this method.

    My wording may be off, but this method seems to work with raster fonts that can't display bytes as arbitrary unicode.

提交回复
热议问题