I am developing a web application, I need to use keyboard to open/switch tabs in following ways,
- When I press ctrl + alt + 1 tab1 should open.
- But without releasing ctrl and alt if I press 2 tab2 should open.
I am able to achieve 1 and 2 but with releasing ctrl and alt keys.
Obviously the way you have used to find the pressed keys is not good when it has ctrl & alt. You can simply listen for the
ctrl+alt+1andctrl+alt+2like this,