mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
evdev: enhance keyboard detection for capslock
This commit is contained in:
@@ -145,9 +145,18 @@ func isKeyboard(device EvdevDevice) bool {
|
|||||||
return true
|
return true
|
||||||
case strings.Contains(name, "input") && strings.Contains(name, "key"):
|
case strings.Contains(name, "input") && strings.Contains(name, "key"):
|
||||||
return true
|
return true
|
||||||
default:
|
}
|
||||||
|
|
||||||
|
keyStates, err := device.State(evKeyType)
|
||||||
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasKeyA := len(keyStates) > 30
|
||||||
|
hasKeyZ := len(keyStates) > 44
|
||||||
|
hasEnter := len(keyStates) > 28
|
||||||
|
|
||||||
|
return hasKeyA && hasKeyZ && hasEnter && len(keyStates) > 100
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) watchForNewKeyboards() {
|
func (m *Manager) watchForNewKeyboards() {
|
||||||
|
|||||||
Reference in New Issue
Block a user