robotgo
robotgo copied to clipboard
robotgo crashes when typing 'ralt' key
- Robotgo version: (latest one you get with go get ...) v0.80.0
- Go version: go version go1.13.10 linux/amd64
- Gcc version: gcc version 9.2.0 (Gentoo 9.2.0-r2 p3)
- Operating system and bit: Linux willow 5.5.5-gentoo x64
- Can you reproduce the bug at Examples:
- [ ] Yes (provide example code)
- [ ] No
- [x] Not relevant
- Provide example code:
(base) imx@willow /tmp $ cat test.go
package main
import "github.com/go-vgo/robotgo"
func main(){
println("Up")
robotgo.KeyToggle("ralt", "up")
}
(base) imx@willow /tmp $ go build test.go
(base) imx@willow /tmp $ ./test
Up
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 132 (XTEST)
Minor opcode of failed request: 2 (X_XTestFakeInput)
Value in failed request: 0x0
Serial number of failed request: 14
Current serial number in output stream: 15
- Log gist:
Description
When trying to toggle ralt
on a system with german keyboard layout, robotgo crashes with the stacktrace you can see above. Thanks!
Is there anything else I can provide to you to locate the culprit?
I did a bit of research and found out that this implementation works fine https://github.com/micmonay/keybd_event/blob/master/keybd_linux.go
Maybe robotgo can borrow some code of it? :)
I tested it on my Ubuntu, can't be reproduced; If the problem persists, please tell me how to reproduce it.
Thanks for your reply and time!
Have you tried it with a german keyboard layout?
On german keyboard layouts you have to press ALTGR+Q to make an "@".
The moment I try to press the ALTGR key (ralt
in robogo) it crashes with the exception above.
But... maybe I am wrong and the ralt
is not the AltGR key but simply a different Alt-Key which isn't on my keyboard?
I think the issue is indeed that the ralt
isn't the gralt
key as I assumed.
I will try to add this to the list and see if it works.
[...]
K_GRALT = XK_ISO_Level3_Shift,
[...]
I have tested it and it works!
XK_ISO_Level3_Shift
is what we need to be able to toggle/press/release.
If you want I can write a little patch for that.
Thanks for robotgo my friend. It's awesome :)
Thks for your feedback, but there is no German keyboard.
No problem my friend.
There are just 2 changes you have to do to support ISO_Level3-Shifting.
This will work for linux machines.
I am not sure about MacOS.
Windows maps the ALTGR key to CTRL+ALT. So for windows there is no change needed.
@AutoAwesome your fix worked! Anyway, it miss the configuration to use it like robotgo.KeyTap("q", "gralt"), can you help me to achieve that?? And in your opinion, to add letters like "òàèù", you have to add
K_O_GRAVE = XK_Ograve
{ "ò", K_O_GRAVE },
for every letters that I miss??