Omnimaga
Calculator Community => TI Calculators => ASM => Topic started by: Runer112 on November 01, 2010, 11:43:36 pm
-
Is there such a thing? I know there are things like GetCSC and direct port input, but I'm wondering if GetKey has a non-waiting equivalent that also uses the A/keyExtend output format.
-
No. I'm not sure how you would want such a routine to work, but no, it does not exist. If you have stuff to do in the background while GetKey is running, you can use a cursor hook, GetKey hook, or silent link hook, as appropriate.
-
Dang, I have no idea how to use hooks... Anyone know of a good guide explaining how hooks work? Or anyone want to post a whirlwind tour of hooks?
-
It's... a bit complicated. Maybe it would help if you could explain what exactly you're trying to do.
-
Isn't there a BCALL somewhere that does exactly that? ???
-
Uh... no. Not what he was asking. There's GetCSC, which he mentioned, and GetK (BASIC's getKey), which he didn't. Both of those routines return raw scancodes; they don't handle the shift keys, contrast control, APD, 2nd+Off, TIKB, or silent link.
-
ahhh gotcha, i only dabble in Asm so i wasn't 100% sure ^^ thanks for the clarification!
-
It's... a bit complicated. Maybe it would help if you could explain what exactly you're trying to do.
I just want to make a program that can work while waiting for key inputs and accepts key inputs in the A/keyExtend format.
-
Dang, I have no idea how to use hooks... Anyone know of a good guide explaining how hooks work? Or anyone want to post a whirlwind tour of hooks?
thepenguin77 gave me a quick guide earlier: http://ourl.ca/7566/131643
-
I just want to make a program that can work while waiting for key inputs and accepts key inputs in the A/keyExtend format.
You said that already. The question is why. For example, "I'm writing a game in which the user needs to type the answers to trivia questions in l33tspeak, while simultaneously using the arrow keys to dodge attacks from a giant lava monster." Or "I'm writing a text editor where all the O's are actually eyes, that follow the cursor around the screen and blink at random intervals."
-
More like the second. The background processes won't be very intensive, maybe static/slightly dynamic grayscale displaying at most.
-
Both of those need to be made right now
-
For grayscale, you might be able to make it work with a GetKey hook, but for accurate timing I'd think you'd want to use an IM 2 handler. To make grayscale look good, you generally want to have consistent timing regardless of whatever else is going on in your program, and regardless of whether the user is pressing keys. I didn't think of mentioning IM 2 handlers before, but that might be the way to go.
On the other hand, a GetKey hook requires less memory to set up.
-
If I remember correctly, if you press the ON key during _getKey a flag is set which causes exactly what you want. If you set this flag manually, it might just work.
-
Yeah, I might not bother with hooks or anything and just set up the program to run in an interrupt with a GetKeyRetOff running outside the interrupt.
-
If I remember correctly, if you press the ON key during _getKey a flag is set which causes exactly what you want. If you set this flag manually, it might just work.
That's an interesting point. I'm not sure if that would work or not.
(If not, a trivial GetKey hook could do the same thing.)
-
This seems to work:
set onInterrupt,(iy+onFlags)
bcall(_GetKey)
-
One thing I would like to point out is that everyone has to start somewhere and can do mistakes and snapping at people for not understanding something or a question or missing a bit of information in a post is generally not a welcome behavior on the forums, regardless of if it comes from an experienced or inexperienced programmer. It goes against the goal of the community and big risks can be taken in long terms if that happens too often.
I haven't followed every help topic thoroughly but in this one I noticed two posts had some rather onobxious responses to other messages.