Skip to content

Commit ec7f029

Browse files
committed
Fix wrong condition in x11key Lookup for ASCII code
* the condition was never met because rune is usually unsigned int * the logical result of checking whether unshifted key rune is ASCII is range from 0 to 0x80
1 parent eab1b5e commit ec7f029

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shiny/driver/internal/x11key/x11key.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (t *KeysymTable) Lookup(detail uint8, state uint16) (rune, key.Code) {
6363

6464
// The key event's code is independent of whether the shift key is down.
6565
var c key.Code
66-
if 0 <= unshifted && unshifted < 0x80 {
66+
if 0 >= unshifted && unshifted < 0x80 {
6767
c = asciiKeycodes[unshifted]
6868
if state&LockMask != 0 {
6969
r = unicode.ToUpper(r)

0 commit comments

Comments
 (0)