For several 'years' now - certainly since 2017 I've been investigating how to incorporate some sort
of low value timeout on accept statements.
I 'sort of' gave up my own ventures back in 2018 and was ably assisted by 'cdg' Carl Goldin - who
has since appeared to have left the GnuCOBOL 'theatre' of war.
He gave me a .c routine that simply read the keyboard and passed the results to my Cobol programs
along with a .cpy module for the return-codes generated by the 'getch' routine he used.
I needed another routine that allowed for key detection 'BUT' with the ability to continue if NO key
had been pressed - so I hacked his code - duplicating 99% of it but using nodelay(stdscr,TRUE);
which effectively looked for a keystroke & if one wasn't present then just exited without any delay.
I just ran it in a tight loop and added 1 to a counter and displayed the result when I entered a key.
Giving me approx 50,000 count for a every second keypress & 3,300,000 for a 60 second delay.
I then needed to detect IF the Capslock key was depressed - so I added a couple of lines of code
I found on the Net to this .c routine & Bingo - I can tell IF the Capslock key is pressed - thus enabling
me to tell IF the Shift Key is pressed irrespective of the Capslock.
eg: If Capslock pressed & detected letter is B then NO Shift key is pressed.
If Capslock pressed & detected letter is b then the Shift key IS pressed.
If Capslock NOT pressed & detected letter is B then Shift key IS pressed.
If Capslock NOT pressed & detected letter is b then Shift key NOT pressed.
The end result of all this is a .dll I incorporate into my programs along with a .cpy module for the
key stroke detection - all well and good.
BUT - I'd really like to obviate all this palaver and get it incorporated into screenio.c & .cpy.
Anyone interested. ??.
I'd like to see an addition to the Accept statement such as Accept x with NOWAIT ... ... ...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For several 'years' now - certainly since 2017 I've been investigating how to incorporate some sort
of low value timeout on accept statements.
I 'sort of' gave up my own ventures back in 2018 and was ably assisted by 'cdg' Carl Goldin - who
has since appeared to have left the GnuCOBOL 'theatre' of war.
He gave me a .c routine that simply read the keyboard and passed the results to my Cobol programs
along with a .cpy module for the return-codes generated by the 'getch' routine he used.
I needed another routine that allowed for key detection 'BUT' with the ability to continue if NO key
had been pressed - so I hacked his code - duplicating 99% of it but using nodelay(stdscr,TRUE);
which effectively looked for a keystroke & if one wasn't present then just exited without any delay.
I just ran it in a tight loop and added 1 to a counter and displayed the result when I entered a key.
Giving me approx 50,000 count for a every second keypress & 3,300,000 for a 60 second delay.
I then needed to detect IF the Capslock key was depressed - so I added a couple of lines of code
I found on the Net to this .c routine & Bingo - I can tell IF the Capslock key is pressed - thus enabling
me to tell IF the Shift Key is pressed irrespective of the Capslock.
eg: If Capslock pressed & detected letter is B then NO Shift key is pressed.
If Capslock pressed & detected letter is b then the Shift key IS pressed.
If Capslock NOT pressed & detected letter is B then Shift key IS pressed.
If Capslock NOT pressed & detected letter is b then Shift key NOT pressed.
The end result of all this is a .dll I incorporate into my programs along with a .cpy module for the
key stroke detection - all well and good.
BUT - I'd really like to obviate all this palaver and get it incorporated into screenio.c & .cpy.
Anyone interested. ??.
I'd like to see an addition to the Accept statement such as Accept x with NOWAIT ... ... ...