Discussions related to Visual Prolog
VPExplorer
Active Member
Posts: 25
Joined: 6 Aug 2012 16:56

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

Unread post 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.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1395
Joined: 28 Feb 2000 0:01

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

Unread post 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
Regards Thomas Linder Puls
PDC
VPExplorer
Active Member
Posts: 25
Joined: 6 Aug 2012 16:56

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

Unread post 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?
User avatar
Thomas Linder Puls
VIP Member
Posts: 1395
Joined: 28 Feb 2000 0:01

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

Unread post by Thomas Linder Puls »

No, you will have to call one of the two mentioned predicates.
Regards Thomas Linder Puls
PDC
Post Reply