Topic: Read tag then write somewhere

Hi,

I'm learning programming in C, I have a touchatag reader and some tags.

I need to use touchatag offline, but it's not possible, so I have to program an app myself.

I want to make a console app (I don't know how to make a GUI), which would be "listening" for a tag, THEN would write the ID everiwhere I am.

For example, I launch my app, minimize it, open notepad, put a tag on the reader, then my app would write the ID on notepad... Or on a focused textbox on a webpage... Or anything else focused and writable (or not).

I'm watching the example page (http://www.libnfc.org/api/examples_page.html), but I don't know how to make an app, write something on a focused element...

I hope someone can help me, or even could tell me what to look for on google ('cause I don't even know how "making an app write on a focused element" can me called...)

PS: Please excuse my english.

Thank you !

Re: Read tag then write somewhere

Hello,

Max13 wrote:

I'm watching the example page (http://www.libnfc.org/api/examples_page.html), but I don't know how to make an app, write something on a focused element...

It seems to be more related with "virtual keyboard", "keyboard events" or "simulate keystroke" than libnfc, isn't it ?
BTW, you don't tell us what is the OS you use and such information is quite useful to better help you. Due to your second post¹, I think you're using Windows, so you could have a look to keybd_event function².

[1] http://www.libnfc.org/community/post/964/#p964
[2] http://msdn.microsoft.com/en-us/library … S.85).aspx

Romuald Conty

Re: Read tag then write somewhere

Yeah.

Sorry, I'm on Windows XP 32 bits & Seven 64 Bits, developping on Dev-Cpp.

MSDN told me to use: "keybd_event".
And it's good for me smile

My script:

int i;
char Txt[] = "Hello World";

for (i=0;i<strlen(Txt);i++) // Isn't working on console, but tested on Notepad
{
    keybd_event(VkKeyScan(Txt[i]), 0, 0, 0); // Pression
    keybd_event(VkKeyScan(Txt[i]), 0, KEYEVENTF_KEYUP, 0); // Key released
}

Thanks for your help !

Last edited by rconty (2010-04-13 14:47:36)

Re: Read tag then write somewhere

Hello,

I have edited your post to add relevant BBCode tag i.e. "[ code ] and [ /code]".

Please see: http://www.libnfc.org/community/help/bbcode/

Romuald Conty