Page 1 of 1

Can you forward a link to the docs for the console class?

Posted: 25 Jan 2022 9:33
by VPExplorer
Not the stdIO class, just the console.

I'm specifically trying to find out if it can read arrow and function keys, not only character strings.

But also generally, I just need the console reference.

Yes, I tried searching the forum for 'console', but the response is that 'console' is too common a term.

Re: Can you forward a link to the docs for the console class?

Posted: 25 Jan 2022 10:08
by Thomas Linder Puls
There is not more documentation than what you see in the console.cl file. To deal key presses etc you will have readEvents (blocking) or getEventQueue (non-blocking):

Code: Select all

domains     event =         key(unsigned KeyDown, unsigned RepeatCount, unsigned VirtualKeyCode,             unsigned VirtualScanCode, char UnicodeChar, unsigned ControlKeyState);         mouse(unsigned CoordX, unsigned CoordY, unsigned ButtonState,             unsigned ControlKeyState, unsigned EventFlags);         size(unsigned CoordX, unsigned CoordY);         menu;         focus.   predicates     readEvents : () -> event* EventList.     % @short Read events or wait     % @end   predicates     getEventQueue : () -> event* EventList.     % @short Read events or return empty list     % @end

Re: Can you forward a link to the docs for the console class?

Posted: 25 Jan 2022 15:44
by VPExplorer
Hi, Thomas.

"There is not more documentation than what you see in the console.cl file."

I didn't know about the existence of that file. Looking at it now, thanks.

"To deal key presses etc you will have readEvents (blocking) or getEventQueue (non-blocking):"

Thanks. Do the console apps have Event support, or do they only work for guis?

Re: Can you forward a link to the docs for the console class?

Posted: 31 Jan 2022 9:51
by Thomas Linder Puls
No, you will have to call one of the two mentioned predicates.