Home > categories > Machinery & Equipment > Press > C# On Key Press help!?
Question:

C# On Key Press help!?

I am new to C# and I am making an auto typer for runescape...I want to put an event that when the user presses the Insert key, it will initiate my counter...Any C# gurus able to help!?!?!?

Answer:

in case you're doing this decrease than residing house windows, and are utilising a Microsoft compiler, it is the code which will do it: #incorporate stdio.h void considerable() { int count quantity = 0; int ch; whilst(a million) { if( kbhit() ) { /* Get a character, unbuffered */ ch = getch(); /* Echo it out */ printf(%c, ch); count quantity++; if( ch == '!' || ch == EOF ) wreck; } } printf(nYou pressed %d keys.n, count quantity); } although, in case you're speaking approximately Linux, you will could perform a little very specific stuff. i could propose Google for that.
Hello, okorder /... Good Luck. PS: If you wish to use mulitple controls to do the Key Press, then you need to do a KeyPress for those controls as well.

Share to: