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

fix: Unknown key: 161 on AZERTY keyboard #784

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

raph6
Copy link
Contributor

@raph6 raph6 commented Mar 25, 2024

Hello, I'm using AZERTY keyboard and got a panic when I'm using the key "<>" (161)

2024/03/25 21:13:33 Unknown key: 161
panic: Unknown key: 161

goroutine 51 [running]:
log.Panicf({0xd2ebf2?, 0xc000079bf0?}, {0xc000079be0?, 0x40eb0b?, 0x47623a?})
        /usr/local/go/src/log/log.go:439 +0x65
github.com/AllenDang/giu.keyFromGLFWKey(0xa1)
        /home/raph/go/pkg/mod/github.com/!allen!dang/[email protected]/Keycode.go:239 +0x105
github.com/AllenDang/giu.(*MasterWindow).SetInputHandler.func1(0x0?, 0xa1?, 0x1, 0x0)
        /home/raph/go/pkg/mod/github.com/!allen!dang/[email protected]/MasterWindow.go:390 +0x38
github.com/AllenDang/cimgui-go.(*GLFWBackend).SetKeyCallback.func1(0xa1, 0x5e, 0x1, 0x0)
        /home/raph/go/pkg/mod/github.com/!allen!dang/[email protected]/glfw_backend.go:435 +0x64
github.com/AllenDang/cimgui-go.keyCallback(0xc000079d00?, 0xa1, 0x5e, 0x1, 0x0)
        /home/raph/go/pkg/mod/github.com/!allen!dang/[email protected]/backend.go:76 +0x67
github.com/AllenDang/cimgui-go._Cfunc_igGLFWRunLoop(0x2b6c190, 0x691450, 0x6914c0, 0x691530, 0x691610)
        _cgo_gotypes.go:24265 +0x45
github.com/AllenDang/cimgui-go.(*GLFWBackend).Run.func1(0x1?)
        /home/raph/go/pkg/mod/github.com/!allen!dang/[email protected]/glfw_backend.go:249 +0x9c
github.com/AllenDang/cimgui-go.(*GLFWBackend).Run(0x0?, 0x0?)
        /home/raph/go/pkg/mod/github.com/!allen!dang/[email protected]/glfw_backend.go:249 +0x32
main.main.(*MasterWindow).Run.func2()
        /home/raph/go/pkg/mod/github.com/!allen!dang/[email protected]/MasterWindow.go:244 +0xcb
github.com/faiface/mainthread.Run.func1()
        /home/raph/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:37 +0x22
created by github.com/faiface/mainthread.Run in goroutine 1
        /home/raph/go/pkg/mod/github.com/faiface/[email protected]/mainthread.go:36 +0xae
exit status 2

I fixed it by adding GLFWKeyWorld1 from here https://github.com/AllenDang/cimgui-go/blob/e81e703b7b872f28c671c03abf69ae6854caa7f7/glfw_backend.h#L61

According to glfw keyboard key tokens here https://www.glfw.org/docs/latest/group__keys.html

I also added GLFWKeyWorld2 because it wasn't there, even if I never had a problem with it.

Copy link
Collaborator

@gucio321 gucio321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, lgtm

@gucio321
Copy link
Collaborator

I'm sorry - forgot to merge 😄

@gucio321 gucio321 merged commit 94d9490 into AllenDang:master Apr 26, 2024
3 of 4 checks passed
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.

2 participants