I have a fairly complicated 2-leo USB controller in late beta -- 98% working I would say -- but I am stymied by one odd thing. The s'ware I'm interacting with (commercial, unhackable) wants me to "hit Enter" at certain points in order to confirm actions, etc.
On my stock OSX box, the key marked RETURN on the (official apple usb) keyboard works for this, as does the key marked ENTER on the keypad to the right of the main keyboard. They seem equivalent, at least in the context of the app.
When I examined the source for the Arduino keyboard library, I found a definition for KEY_RETURN. A button on my hardware UI panel causes the Keyboard/Mouse Leonardo device to do this:
case 7:
// ENTER
Keyboard.write(KEY_RETURN);
break;
I write many other key values (many buttons sending keystrokes to the app) using the same syntax, and they all work; but for some reason the commercial app does not see KEY_RETURN as "Enter". Now, xev tells me that when I hit the return key I get keycode 44, "Return" -- which makes me suspect that the commercial app should also be seeing Return when I hit Return, and it accepts this (from my keyboard) as "Enter". But it does not accept KEY_RETURN from a Leo as "Enter".
Using an xterm I can verify that when the user hits the relevant button on my UI panel, I do get a return, i.e. I can complete and execute a unix command by hitting this button, I get a crlf, etc.
I am baffled. Why is KEY_RETURN not equivalent to pressing RETURN on my keyboard?
I googled around and found that others have had this problem (aha!) but I did not find any solutions (sigh). I did find some advice about using the Arduino library symbol KEY_ENTER, but this sym is not defined in the current revision of the library on github, and when I try to use it I get an undefined symbol error on compile.
I have found no list of keycodes for the numpad. If I could find some, KP_ENTER might work (the app accepts keypad_enter as equivalent to "Enter"). Has anyone made an additional list of byte constants for keypad keys? (Why does the Arduino keyboard library not include keypad keys, btw?)
It is rather frustrating to be this close to success and then hit some weird keycode mapping issue for just one key, but I am betting there is a way to do this... would be very grateful for some guidance.