Teen Programmers Unite  


Return to forum top

Direct Input Textbox

Posted by Cortez [send private reply] at July 12, 2003, 11:12:38 AM

How can I make a similar typing like Windows' textboxes (i mean, when you hold a button in windows, it wait after the first press for a while, and goes faster after..). It doesn't matter if delay is same or not, I just want to get proper text input

Posted by CViper [send private reply] at July 12, 2003, 04:51:12 PM

Just make sure you TranslateMessage() all incoming messages - this will automatically generate appropriate WM_CHAR messages (including delay, dead characters etc).

The harder thing is to correctly implement inserting/removing/editing.

Posted by Cortez [send private reply] at July 13, 2003, 08:05:28 AM

Can't figure it out.. :( I made a global char, and

case WM_DOWN:
g_GlobalChar = wParam;

and used it directly:

char temp[2];
temp[0] = g_GlobalChar;
temp[1] = '\0';

PrintFunction( temp );

Bad thing is, it keeps the previous pressed value after the key is up again. Can you write a short example so I can see how I can do it?

You must be logged in to post messages and see which you have already read.

Log on
Save for later automatic logon

Register as a new user
Copyright TPU 2002. See the Credits and About TPU for more information.