I am using a NFC reader to read the UID of a M1 card and I would like to insert this UID string to anywhere the cursor currently is.
e.g. in the url box, in notepad, (just like a “barcode” reader input device, but with NFC UID this time)
I have implemented the function for reading the UID, and now I would like to do my second part – to insert the UID to anywhere the cursor is.
I am using Visual C++, any idea?
If you want to simulate a keypress, you can add input events:
That sends a key-down, followed by a key-up for the ‘A’ key. You can submit an array of those structures in a single call, I’ve omitted that for clarity. Note also that the key is not ascii, but a VK code. It just so happens that the alpha keys are represented by their upper-case value.
Obviously if the user happens not to have the cursor somewhere that they want characters to be entered, bad/unexpected things may happen.