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

Words, delays... #28

Open
ghost opened this issue Jan 18, 2017 · 3 comments
Open

Words, delays... #28

ghost opened this issue Jan 18, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 18, 2017

OK, so I have the g13d installed, and after resolving an issue with /dev/uinput being unwriteable by default even with the udev config installed (I think the solution was ultimately to add myself to the "input" group that the device apparently belonged to along with root so 0660 worked) I have been able to bind its keys. Small issue binding -- if you just cat a long list of bindings into /tmp/g13_0 you risk losing characters as the device appears to be slow. I fixed this by binding with a shell script and simply put a sleep 1 command in between each binding and it worked fine.

The two remaining problems I seem to be having are: I'd like to send whole words on a keypress. E.g. in WoW one can bow to those around you with /bow, so I have programmed a key with:

KEY_SLASH+KEY_B+KEY_O+KEY_W+KEY_ENTER

and it works fine, although it is tedious to code. However, the device doesn't output each key "separately". If I try entering \sleep this way, the two e's are compressed to 1, \slep. Which fails. There isn't much documentation, so I'm not sure if I'm doing this correctly, but it is certainly something I'd like to be able to do, ideally with a much easier unixoid syntax, like: bind G10 "/sleep\r".

The second useful thing would be delays and/or durations. In game play, pressing and holding a key is interpreted from the raw keyboard so making and breaking the contact are separate events IIRC. Hence pressing w and holding it runs you straight in WoW until you release the key. In a lot of key sequences one might like to construct, they would be things like:

"press w for 0.77 milliseconds, release it and type in a single space, then press d for 0.54 seconds, then enter the string '/stealth\n' typed".

I see hints about being able to use the input and output pipes in some way to accomplish this sort of thing with external scripting code, but again there is little in the documentation about how to go about it. Can I get a G11 keypress to send a signal to /tmp/g13_0_out or whatever to be picked up by a script which generates the desired sequence of keys and sends them in to be delivered to the fake "keyboard" as if they were typed? Or is this just impossible...?

@rivermc
Copy link

rivermc commented Sep 25, 2017

Greetings! Thank you for that scrirpt. Purchased the device just for texting function. I cannot execute even a default action >Hello. No errors during config loading, but it doesnt text when I push the key. In an action like KEY_SLASH+KEY_B+KEY_O+KEY_W+KEY_ENTER also got a trouble with entering 2 same symbols and using shift or ctrl buttons. Please help and thank you very much

@kruziheidanei
Copy link

Hello,

sorry, I don't fully understand (language?) whether there is (now) a solution for sending e.g. words through the "virtual" keyboard to the game?

@pascal-mignot-urca
Copy link

Same comment as ghost, except I'm using it for Latex command input.
My problems are globally the same: duplicate keys removed from the output even when they are appart (only the first is sent) and upper/lower switch impossible (shift acts as caps-lock, impossible to remove when pressed).
Is there a simple way to remove theses limitations from the code, or at least, tells me if the duplicate key filtering is coming from the code (where?) or some usb/device properties?
Regards

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

No branches or pull requests

3 participants