Personal Rant: The !@%!! SCREEN command is a BLEEEEPING BLEEP BLEEP!!! It can bite my little BLEEPING BLLEEEP BLERP!! I HOPE TO NEVER HAVE TO TAKE ANOTHER LOOK INSIDE THE BLEEPING BLEEPING BLORKING BLAAARF THAT IT IS, EVER AGAIN!!!
And, with that informative rant said, I now have SCREEN support enabled for the CONSOLE.
_SCREEN (x,y,0) returns the ASCII character value of point (x,y) on the console.
_SCREEN (x,y,1) returns the COLOR character value of point(x,y) on the console.
NOTE: This requires that you set your source to the console, so SCREEN knows where to look for information. For example:
$CONSOLE
_CONSOLE ON
_ECHO "Hello World"
PRINT "Screen can bite my hiney!"
PRINT SCREEN(1,1,0)
With the above, what is the screen command going to print for us? The information for the screen, or the information for the console??
With no _SOURCE set, it's going to print the ASCII value for "S" -- the character on the screen.
If you want to get the value for the console, simply set the source to console first, as so:
$CONSOLE
_CONSOLE ON
_ECHO "Hello World"
PRINT "Screen can bite my hiney!"
_SOURCE _CONSOLE
PRINT SCREEN(1,1,0)
Note 2: Most of these commands require _DEST or _SOURCE to be set to _CONSOLE before calling them, so you can differentiate between the console and screen with them.
Upcoming next is the _NAME_TO_BE_DETERMINED command to allow us to get single keystrokes from the console, without having to depend on ENTER being an input terminator. This one isn't one that fits nicely into any of the existing commands, as it behaves much differently than INKEY$ or _KEYHIT. For one thing, it's STILL a function which pauses program execution when it's called -- it doesn't return a "" or 0 as a NULL return. As a second point, it returns a different set of scan codes than INKEY or _KEYHIT uses...
For the codepage which the _NAME_TO_BE_DETERMINED command uses, take a look at the page here:
https://www.qb64.org/wiki/Keyboard_scancodes and scroll down to the
INP Scan Codes heading and view them.
As for the name of this command, I'm thinking _CONSOLESCANCODE seems rather longish to me, and _CONSOLEINP seems a little goofy, as if somebody forgot to add an UT to the end of the INP.. I'd like a command name that is both descriptive and not so long to type over and over...
_CINP may be the name I go with, as this is very similar to a _CONSOLE version of the INP command, but I'm open to any suggestions. As long as I'm still developing and pushing things into my personal repo, nothing is set in stone, so a name change can happen at any time, if anybody has a nice suggestion for me. Just give me a good idea for what to call the command, before I end up pushing all these changes into QB64's development repo. ;)