diff --git a/internal/help/Keyword_Reference_-_Alphabetical.txt b/internal/help/Keyword_Reference_-_Alphabetical.txt index 4fba26604..43c20c0f0 100644 --- a/internal/help/Keyword_Reference_-_Alphabetical.txt +++ b/internal/help/Keyword_Reference_-_Alphabetical.txt @@ -7,7 +7,7 @@ __NOTOC__ <p style="text-align: center">[[Keyword Reference - By usage|Go to keywords by Usage]]</p> -<p style="text-align: center">Keywords beginning with _underscores are QB64 specific.</p> +<p style="text-align: center">Keywords beginning with _underscores are QB64 specific. '''To use them without the prefix, use [[$NOPREFIX]].'''</p> <p style="text-align: center">[[Keywords currently not supported by QB64]]</p> @@ -75,6 +75,7 @@ __NOTOC__ * [[_CAPSLOCK]] (statement) {{text|sets Caps Lock key state}} * [[$CHECKING]] (QB64 C++ [[Metacommand]]) {{text|turns event error checking OFF or ON.}} * [[_CEIL]] (function) {{text|Rounds x upward, returning the smallest integral value that is not less than x.}} +* [[_CINP]] (function) {{text|Returns a key code from $CONSOLE input}} * [[_CLEARCOLOR (function)]] {{text|returns the current transparent color of an image.}} * [[_CLEARCOLOR]] (statement) {{text|sets a specific color index of an image to be transparent}} * [[_CLIP]] ([[PUT (graphics statement)|PUT]] graphics option) {{text|allows placement of an image partially off of the screen.}} @@ -88,6 +89,7 @@ __NOTOC__ * [[_CONNECTIONADDRESS$]] (TCP/IP function) {{text|returns a connected user's STRING IP address value using the handle.}} * [[$CONSOLE]] (QB64 [[Metacommand]]) {{text|creates a console window that can be used throughout a program.}} * [[_CONSOLE]] (statement) {{text|used to turn a console window OFF or ON or to designate [[_DEST]] _CONSOLE for output.}} +* [[_CONSOLEINPUT]] (function) {{text|fetches input data from a [[$CONSOLE]] window to be read later (both mouse and keyboard)}} * [[_CONSOLETITLE]] (statement) {{text|creates the title of the console window using a literal or variable [[STRING|string]].}} * [[_CONTINUE]] (statement) {{text|skips the remaining lines in a control block (DO/LOOP, FOR/NEXT or WHILE/WEND)}} * [[_CONTROLCHR]] (statement) {{text|[[OFF]] allows the control characters to be used as text characters. [[ON]] (default) can use them as commands.}} @@ -204,7 +206,7 @@ __NOTOC__ <div id = "uK">_K</div> -*[[_KEYCLEAR]] (function) {{text|clears the keyboard buffers for INKEY$, _KEYHIT, and INP.}} +*[[_KEYCLEAR]] (statement) {{text|clears the keyboard buffers for INKEY$, _KEYHIT, and INP.}} *[[_KEYHIT]] (function) {{text|returns [[ASCII]] one and two byte, SDL Virtual Key and [[Unicode]] keyboard key press codes.}} *[[_KEYDOWN]] (function) {{text|returns whether CTRL, ALT, SHIFT, combinations and other keys are pressed.}} @@ -856,7 +858,7 @@ __NOTOC__ ==OpenGL specific keywords:== <center>'''All QB64 OpenGL keywords must use the underscore _gl prefix with the alphabetically listed function names.'''</center> -<center>'''The following keywords cannot be used in QB64 versions .954 and below.'''</center> +<center>Use [[$NOPREFIX]] to enable these to be used without the leading underscore.</center> <div id = "glA">_glA</div> diff --git a/internal/help/_CINP.txt b/internal/help/_CINP.txt new file mode 100644 index 000000000..5423bf450 --- /dev/null +++ b/internal/help/_CINP.txt @@ -0,0 +1,59 @@ +{{DISPLAYTITLE:_CINP}} +The [[_CINP]] function returns keyboard key press codes from a [[$CONSOLE]] window. Windows-only. + + +{{PageSyntax}} +:{{Parameter|keycode&}} = [[_CINP]] + + +{{PageDescription}} +* Return values are the same as the ones for [[INP]] when used to read keyboard input. See table below. +:* '''Negative''' [[LONG]] values returned indicate that a key was released or a lock function key has been turned off. +* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. + +{{WhiteStart}}' '''Extended Keyboard Press Scancodes''' +' +'''' Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SysReq ScrL Pause''' +' 1 59 60 61 62 63 64 65 66 67 68 87 88 0 70 29 +' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSpc Insert Home PgUp NumL / * -''' +' 41 2 3 4 5 6 7 8 9 10 11 12 13 14 82 71 73 69 53 55 74 +' '''Tab Q W E R T Y U I O P [{ ]} \| Delete End PgDn 7/Home 8/▲ 9/PU + ''' +' 15 16 17 18 19 20 21 22 23 24 25 26 27 43 83 79 81 71 72 73 78 +' '''CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► E''' +' 58 30 31 32 33 34 35 36 37 38 39 40 28 75 76 77 '''n''' +' '''Shift Z X C V B N M ,< .> /? Shift ▲ 1/End 2/▼ 3/PD t''' +' 42 44 45 46 47 48 49 50 51 52 53 54 72 79 80 81 '''e''' +' '''Ctrl Win Alt Spacebar Alt Win Menu Ctrl ◄- ▼ -► 0/Insert ./Del r''' +' 29 {{text|91|purple}} 56 57 56 {{text|92 93|purple}} 29 75 80 77 82 83 28 +' +{{WhiteEnd}} + + +{{PageExamples}} +''Example 1:'' Reading individual key strokes from a console window (Windows). +{{CodeStart}} '' '' +{{Cl|$CONSOLE}}:ONLY +{{Cl|_DEST}} {{Cl|_CONSOLE}}: {{Cl|_SOURCE}} {{Cl|_CONSOLE}} + +{{Cl|PRINT}} "Press any key, and I'll give you the scan code for it. <ESC> quits the demo." +{{Cl|PRINT}} +{{Cl|PRINT}} +{{Cl|DO}} + x = {{Cl|_CONSOLEINPUT}} + {{Cl|IF}} x = 1 {{Cl|THEN}} 'read only keyboard input ( = 1) + c = {{Cl|_CINP}} + {{Cl|PRINT}} c; + {{Cl|END IF}} +{{Cl|LOOP}} {{Cl|UNTIL}} c = 1 +{{Cl|END}} +{{CodeEnd}} + + +{{PageSeeAlso}} +* [[$CONSOLE]], [[_CONSOLE]] +* [[_CONSOLEINPUT]] +* [[_MOUSEX]], [[_MOUSEY]], [[_MOUSEBUTTON]], [[_MOUSEWHEEL]] + + + +{{PageNavigation}} diff --git a/internal/help/_CONSOLEINPUT.txt b/internal/help/_CONSOLEINPUT.txt new file mode 100644 index 000000000..bc63424aa --- /dev/null +++ b/internal/help/_CONSOLEINPUT.txt @@ -0,0 +1,43 @@ +{{DISPLAYTITLE:_CONSOLEINPUT}} +The [[_CONSOLEINPUT]] function is used to monitor any new mouse or keyboard input coming from a $CONSOLE window. It must be called in order for [[_CINP]] to return valid values. Windows-only. + + +{{PageSyntax}} +:{{Parameter|infoExists%%}} = [[_CONSOLEINPUT]] + + +{{PageDescription}} +* Returns 1 if new keyboard information is available, 2 if mouse information is available, otherwise it returns 0. +* Must be called before reading any of the other mouse functions and before reading [[_CINP]]. +* To clear all previous input data, read [[_CONSOLEINPUT]] in a loop until it returns 0. +* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. + + +{{PageExamples}} +''Example 1:'' Reading individual key strokes from a console window (Windows). +{{CodeStart}} '' '' +{{Cl|$CONSOLE}}:ONLY +{{Cl|_DEST}} {{Cl|_CONSOLE}}: {{Cl|_SOURCE}} {{Cl|_CONSOLE}} + +{{Cl|PRINT}} "Press any key, and I'll give you the scan code for it. <ESC> quits the demo." +{{Cl|PRINT}} +{{Cl|PRINT}} +{{Cl|DO}} + x = {{Cl|_CONSOLEINPUT}} + {{Cl|IF}} x = 1 {{Cl|THEN}} 'read only keyboard input ( = 1) + c = {{Cl|_CINP}} + {{Cl|PRINT}} c; + {{Cl|END IF}} +{{Cl|LOOP}} {{Cl|UNTIL}} c = 1 +{{Cl|END}} +{{CodeEnd}} + + +{{PageSeeAlso}} +* [[$CONSOLE]], [[_CONSOLE]] +* [[_CINP]], [[Keyboard_scancodes#INP_Scan_Codes|Scan Codes]] +* [[_MOUSEX]], [[_MOUSEY]], [[_MOUSEBUTTON]], [[_MOUSEWHEEL]] + + + +{{PageNavigation}} diff --git a/internal/help/links.bin b/internal/help/links.bin index 180719ba3..f3d57d7bd 100644 --- a/internal/help/links.bin +++ b/internal/help/links.bin @@ -31,6 +31,7 @@ _CAPSLOCK,_CAPSLOCK (function) _CAPSLOCK,_CAPSLOCK $CHECKING,$CHECKING _CEIL,_CEIL +_CINP,_CINP _CLEARCOLOR,_CLEARCOLOR (function) _CLEARCOLOR,_CLEARCOLOR _CLIP,_CLIP @@ -44,6 +45,7 @@ _CONNECTED,_CONNECTED _CONNECTIONADDRESS$,_CONNECTIONADDRESS$ $CONSOLE,$CONSOLE _CONSOLE,_CONSOLE +_CONSOLEINPUT,_CONSOLEINPUT _CONSOLETITLE,_CONSOLETITLE _CONTINUE,_CONTINUE _CONTROLCHR,_CONTROLCHR