Skip to content

Commit

Permalink
windows: Add Alt-Backspace support
Browse files Browse the repository at this point in the history
  • Loading branch information
peterh committed Feb 11, 2019
1 parent 9dd826b commit abb5e9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions input_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ type key_event_record struct {
// These names are from the Win32 api, so they use underscores (contrary to
// what golint suggests)
const (
vk_back = 0x08
vk_tab = 0x09
vk_menu = 0x12 // ALT key
vk_prior = 0x21
Expand Down Expand Up @@ -212,6 +213,9 @@ func (s *State) readNext() (interface{}, error) {

if ke.VirtualKeyCode == vk_tab && ke.ControlKeyState&modKeys == shiftPressed {
s.key = shiftTab
} else if ke.VirtualKeyCode == vk_back && (ke.ControlKeyState&modKeys == leftAltPressed ||
ke.ControlKeyState&modKeys == rightAltPressed) {
s.key = altBs
} else if ke.VirtualKeyCode == bKey && (ke.ControlKeyState&modKeys == leftAltPressed ||
ke.ControlKeyState&modKeys == rightAltPressed) {
s.key = altB
Expand Down

0 comments on commit abb5e9d

Please sign in to comment.