Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Set keyMax to 248 in order to prevent keyboard issues on Android syst…
Browse files Browse the repository at this point in the history
…ems. This fixes #24.
  • Loading branch information
bendahl committed Mar 25, 2021
1 parent baaf192 commit 9a0b285
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion keyboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func createVKeyboardDevice(path string, name []byte) (fd *os.File, err error) {
}

// register key events
for i := 0; i < keyMax; i++ {
for i := 0; i <= keyMax; i++ {
err = ioctl(deviceFile, uiSetKeyBit, uintptr(i))
if err != nil {
deviceFile.Close()
Expand Down
6 changes: 3 additions & 3 deletions keycodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ const (
KeyBrightnessZero = 244 /*BrightnessOff,UseAmbient*/
KeyDisplayOff = 245 /*DisplayDeviceToOffState*/
KeyWimax = 246
KeyRfkill = 247 /*KeyThatControlsAllRadios*/
KeyMicmute = 248 /*Mute/UnmuteTheMicrophone*/
keyMax = 0x2ff // highest key currently defined
KeyRfkill = 247 /*KeyThatControlsAllRadios*/
KeyMicmute = 248 /*Mute/UnmuteTheMicrophone*/
keyMax = 248 // highest key currently defined in this keyboard api
)

0 comments on commit 9a0b285

Please sign in to comment.