You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
517 B
Go

// +build !xdr
package hid
import (
_ "embed"
"encoding/json"
)
//go:embed generated.json
var file []byte
func init() {
json.Unmarshal(file, &Mappings)
}
func GetMappingFromHID(uv uint16) Key {
return Mappings.Usb[uv]
}
func GetMappingFromWindows(uv uint16) Key {
return Mappings.Win[uv]
}
func GetMappingFromLinux(uv uint16) Key {
return Mappings.Evdev[uv]
}
func GetMappingFromName(name string) Key {
return Mappings.Code[name]
}
func GetMappingFromX(code uint16) Key {
return Mappings.Xkb[code]
}