I am making a custom controller which emulates a keyboard using additional software (AACKeys). I can see that the controller is working fine, since I can see the keys I send from the controller in various applications like notepad or in web sites(https://typewritesomething.com/). Unfortunately, I can’t make the keys to work in the HTML5 game from GDevelop. It’s doesn’t read the keystrokes unless I use the real keyboard on my PC. I have tested this on win7 and win10 using Firefox and Edge.
The AACKeys software reads ASCII characters from the serial port which translates into keystrokes. It’s a pretty basic application and it working without any issues on win7 and win10 setups.
Anyone has a clue how the keyboard is handled in GDevelop or what I should try?
I don’t know the reason of using another software but GDevelop has an Extension for Gamepads here is the example
It’s not a game pad that connects on a USB port as an HID class device , so I can’t use this extension.
The keyboard and the gamepad are two different things.
The keyboard is native in the game, it’s bundled with electron (electron is a chrome browser for portable app used in GD as base for run your games.)
And the gamepad used an API in this electron. This API is dedicated to the gamepad only.
With your have you tryed to type here ?
Can you write with your keyboard in Discord ? (discord use electron)
Can you type on character here and show me the result.
Maybe your keyboard return a special character and this one cannot be read by the engine.
I said maybe.
I tried both links (not the Discord app though) and I could type/see the characters using the custom controller. No special characters while testing on the second link. I also tried playing around on w3school with some examples that involved a keyboard and it was also working fine.
This is how I handle the Keyboard:
So GDevelop and electron work fine no need to test in Discord.
Ensure your expression in the condition is correct, use it for display the value as string in a text object.
Well, I did try that at some point. I could see the characters as I was typing on the keyboard, but when using the custom controller I didn’t receive anything.
I am using the Developer tools to debug the game at the moment and I can see that if I enable ‘Event Listener Breakpoints’ I do get the breakpoint to trigger on ‘runtimegame-pixi-renderer,js’ when I use the custom controller. I can also see that the key is correctly identified (it’s d):
OK, I finally got it!
I had to switch from “Key pressed” to “Key released” event in the code to make it work with the custom controller. Not sure why it works though, any ideas?
Thank you all for your help.
Excuse me Steliosm for spamming your post but what is “Developer tools”.
I see it works in twin with GDevelop but i don’t know what it is and how to get it.
Thanks to reply et again, excuse me for my spam
It’s located in the Browser’s menu. For example, for Firefox, it’s called “Web Developer”.
Is this what you are asking?
Yes, it’s that exactly. With Microsoft Edge, it is called in french (“Outils de développement” ) or “Developer tools” too in english version of Edge.