File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
shiny/driver/internal/x11key Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 44
55//go:generate go run gen.go
66
7- // x11key contains X11 numeric codes for the keyboard and mouse.
7+ // Package x11key contains X11 numeric codes for the keyboard and mouse.
88package x11key // import "golang.org/x/exp/shiny/driver/internal/x11key"
99
1010import (
@@ -30,12 +30,14 @@ const (
3030 Button5Mask = 1 << 12
3131)
3232
33+ // KeysymTable holds current table of keyboard keys mapped to Xkb keysyms & current special modifiers bits
3334type KeysymTable struct {
3435 Table [256 ][6 ]uint32
3536
3637 NumLockMod , ModeSwitchMod , ISOLevel3ShiftMod uint16
3738}
3839
40+ // Lookup converts Xkb xproto keycode (detail) & mod (state) into mobile/event/key Rune & Code
3941func (t * KeysymTable ) Lookup (detail uint8 , state uint16 ) (rune , key.Code ) {
4042 te := t .Table [detail ][0 :2 ]
4143 if state & t .ModeSwitchMod != 0 {
@@ -86,6 +88,7 @@ func isKeypad(keysym uint32) bool {
8688 return keysym >= 0xff80 && keysym <= 0xffbd
8789}
8890
91+ // KeyModifiers returns mobile/event/key modifiers type from xproto mod state
8992func KeyModifiers (state uint16 ) (m key.Modifiers ) {
9093 if state & ShiftMask != 0 {
9194 m |= key .ModShift
You can’t perform that action at this time.
0 commit comments