Sorry: I always try not to be too verbose, but I alway end up having to explain what the hell I am doing....
We are talking about Bluetooth HID protocol.
I am experimenting on sending, from a Nordic chip, a string with I capture on LC with "KeyDown", in mobile devices.
The string is composed like this (comma delimited):
Code: Select all
StartChar,1 digit number,MAC address,a 2 digit number, EndChar
My LC routine, which is placed in a "front" script, detects the 1st character (StartChar):
If it is the "decided start char", then the KeyDown collects the rest of the string, up to the ending char (EndChar) and does something with the received string.
If not, it passes the KeyDown to whatever the user is typing.
The BT device sends each value chosen from a HID table (see
https://gist.github.com/ekaitz-zarraga/ ... 5a5723969b).
Must be noted that unfortunately the value received IS NOT a char num, BUT a keyboard position.
In order to not interfere with the normal text input of a user in my standalone, the StartChar must be unique and something that a casual user will never type (not even in a password).
This thing works fine, as long as I use one of the keyboard keys that doesn't change position according to the language: the key "1" doesn't seems to change position if I use a keyboard set to Italian or USA, or French, etc (don't know yet about QUERTY and DVORAQ).
But special chars move around with the change of language, except, perhaps, a few ones, like the F1,F2 etc (this is the reason of my FunctionKey choice).
Probably, using a defined sequence of chars, instead of a single one, as a Startchar, could solve my problem. But it would add a lot of complexity to my routine and I would like to avoid it.
Remember that in the standalone the user will have plenty of input fields, scrolling etc, that should work without a glitch.
Being my script so dangerous for a normal use of a standalone, I must be sure that it works fine in any situation and be able to debug it in the IDE. This is why I am using the "Type" command to do simulation on my Mac.
I hope to have explained myself well enough.
Then if you want to know why I need to do all this, that will require another long explanation
