How to map Ctrl+A and Ctrl+Shift+A differently?

前端 未结 6 497
别那么骄傲
别那么骄傲 2020-12-04 17:20

In a terminal, one cannot distinguish Ctrl+A and Ctrl+Shift+A as they both emit the same key code, so I can see why Vi

6条回答
  •  独厮守ぢ
    2020-12-04 17:56

    As you've noted, you get the same keycode. So the only way to distinguish them is to check the state of the Shift key in your event handling function. Of course, if you have more than 0.5 second delay between keypress and processing, you'll miss some hits.

提交回复
热议问题