Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: kevinkore3 on March 31, 2015, 10:01:47 pm

Title: Key presses
Post by: kevinkore3 on March 31, 2015, 10:01:47 pm
There is the isKeyPressed function, but that only detects the state of the key.
Say, for example, open a text editor and hold a key. One character will show up at first, then after half a second or so a bunch will start showing up rapidly.
Is there a function to capture this type of input in the SDK or should I implement one?
I'm curious because in a program I'm making I'm using tabs to loop through things, but it just loops through everyone really fast.
Title: Re: Key presses
Post by: Vogtinator on April 02, 2015, 08:09:08 am
That's automated key repetition and not implemented in libndls as it is more low-level (isKeyPressed reads from the keypad buffer directly).
You'll have to implement it yourself by using a counter variable and some booleans.
Title: Re: Key presses
Post by: Legimet on April 02, 2015, 02:52:45 pm
I implemented something like that in nPDF for the arrow keys. You might want to look at the source code: https://github.com/Legimet/nPDF. And you can copy my code into your project under the terms of the GPL.
Title: Re: Key presses
Post by: kevinkore3 on April 04, 2015, 05:45:50 pm
On another note, is it possible to get fstream working? I'm missing basic_string.tcc (and probably other things) on my Windows machine, and my Linux laptop makes super large bogus a.outs that don't run.
Title: Re: Key presses
Post by: Vogtinator on April 07, 2015, 04:41:25 pm
You have to build the "new" SDK from source: http://github.com/ndless-nspire/Ndless
On Windows, use Cygwin, on linux it should work directly. fstream is fully supported, as is everything except threads.
See also http://hackspire.unsads.com/wiki/index.php/C_and_assembly_development_introduction_on_Linux