mirror of
https://github.com/OrbTools/OrbCommon
synced 2024-11-16 06:12:52 +00:00
simplify hid management
This commit is contained in:
parent
3447f9acb2
commit
e3767b08b0
17
hid/hid.go
17
hid/hid.go
@ -32,19 +32,6 @@ var file []byte
|
||||
func init() {
|
||||
json.Unmarshal(file, &Mappings)
|
||||
}
|
||||
func GetWindowsFromHid(uv uint16) uint16 {
|
||||
return Mappings.Usb[uv].Win
|
||||
}
|
||||
func GetHidFromWindows(uv uint16) uint16 {
|
||||
return Mappings.Win[uv].Usb
|
||||
}
|
||||
|
||||
func GetLinuxFromHid(uv uint16) uint16 {
|
||||
return Mappings.Usb[uv].Evdev
|
||||
}
|
||||
func GetHidFromLinux(uv uint16) uint16 {
|
||||
return Mappings.Evdev[uv].Usb
|
||||
}
|
||||
|
||||
func GetMappingFromHID(uv uint16) Key {
|
||||
return Mappings.Usb[uv]
|
||||
@ -61,3 +48,7 @@ func GetMappingFromLinux(uv uint16) Key {
|
||||
func GetMappingFromName(name string) Key {
|
||||
return Mappings.Code[name]
|
||||
}
|
||||
|
||||
func GetMappingFromX(code uint16) Key {
|
||||
return Mappings.Xkb[code]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user