PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Text input

I'm trying to write an input text control, but I'm not sure how to get the actual text. I'm using OnButtonDown to get the key, but since it only gives me the scan code, I need to take care for the rest of the stuff myself (upper casing for example).

I saw the GetChar function, but I have no idea how to use it (it always returns a null character).

In addition, how can I check for the CapsLock key?


- Gilad Novik
Hi Gilad,

You can read characters from the input buffer through ecd. Here is a small sample:

Code:

//OnNextFrame:
WCHAR chr = ecd.input->GetChar();
while(chr)
{
//place 'chr' in your inputfield
chr = ecd.input->GetChar();
}

You don't need to check for the capslock or shift state, characters will be converted automatically.
gilad_no · 13 Feb 2007, 19:24 UTC — What about repeating?
Thanks for the reply, this is exactly what I was looking for.

What about repeating keys? If the user holds down on a key, will the framework handle it?

- Gilad
gilad_no wrote:What about repeating keys? If the user holds down on a key, will the framework handle it?


No need for an answer. I did a simple test and it's working. Thanks :D