Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunrise-20 GLFW: Stop-gap to avoid crashing on non-printable keys #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cben
Copy link
Contributor

@cben cben commented Jun 30, 2024

[EDIT: I'm on Linux under wayland]
When trying sbcl --load src/bootstrap-glfw.lisp, key presses are already appended to box (even if not re-rendered but box is logged to stdout). But touching any key that is not alphanumeric tends to crash e.g.

debugger invoked on a SIMPLE-TYPE-ERROR in thread
#<THREAD tid=786576 "main thread" RUNNING {10010D81B3}>:
  Symbol name is not of length one: :MINUS

similarly, can't test non-nil mod-keys because touching a mod key crashes:

  Symbol name is not of length one: :LEFT-SHIFT

With this quick fix, you can at least go through the motions of modded keys:

glfw3 key-callback key3: LEFT-SHIFT scancode: 50 action: PRESS mod-keys: NIL input type: KEYWORD
  Error converting key to character: Symbol name is not of length one: :LEFT-SHIFT, ignoring.
  the initial box now: #<DATA-BOX H >
glfw3 key-callback key3: A scancode: 38 action: PRESS mod-keys: (SHIFT) input type: KEYWORD
  the initial box now: #<DATA-BOX HA >
glfw3 key-callback key3: A scancode: 38 action: RELEASE mod-keys: (SHIFT) input type: KEYWORD
"key-callback nothing"
glfw3 key-callback key3: LEFT-SHIFT scancode: 50 action: RELEASE mod-keys: (SHIFT) input type: KEYWORD

[Even if the mods are ignored; (CHARACTER :A) returns #\A either way. I suppose it'll get better once handle-boxer-input can be used...]

When trying `sbcl --load src/bootstrap-glfw.lisp`, key presses are
already appended to box (even if not re-rendered but box is logged to stdout).
But touching any key that is not alphanumeric tends to crash e.g.

```
debugger invoked on a SIMPLE-TYPE-ERROR in thread
#<THREAD tid=786576 "main thread" RUNNING {10010D81B3}>:
  Symbol name is not of length one: :MINUS
```

similarly, can't test non-nil mod-keys because touching a mod key crashes:
```
  Symbol name is not of length one: :LEFT-SHIFT
```

With this quick fix, you can at least go through the motions of modded keys:
```
glfw3 key-callback key3: LEFT-SHIFT scancode: 50 action: PRESS mod-keys: NIL input type: KEYWORD
  Error converting key to character: Symbol name is not of length one: :LEFT-SHIFT, ignoring.
  the initial box now: #<DATA-BOX H >
glfw3 key-callback key3: A scancode: 38 action: PRESS mod-keys: (SHIFT) input type: KEYWORD
  the initial box now: #<DATA-BOX HA >
glfw3 key-callback key3: A scancode: 38 action: RELEASE mod-keys: (SHIFT) input type: KEYWORD
"key-callback nothing"
glfw3 key-callback key3: LEFT-SHIFT scancode: 50 action: RELEASE mod-keys: (SHIFT) input type: KEYWORD
```

[Even if the mods are ignored; (CHARACTER :A) returns #\A either way.
I suppose it'll get better once `handle-boxer-input` can be used...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant