Bugs in GetKeyFlags()

7 views
Skip to first unread message

Carlo Hogeveen

unread,
Mar 11, 2022, 7:07:52 AM3/11/22
to Semware @ GoogleGroups

The many bugs in the GetKeyFlags() function are probably known since
forever, but I documented them with a test macro, which increases a bug's
chance of getting solved, and it documents which parts do work.

https://ecarlo.nl/tse/files/TSE_Pro_Undocumented_Features.html#GetKeyFlags

I checked Semware's and my macros, but we only use GetKeyFlags() to check if
either of the Shift keys is pressed and to check the NumLock key, for both
of which GetKeyFlags() does work.

Carlo



C.H. Fred

unread,
Mar 11, 2022, 7:16:04 AM3/11/22
to sem...@googlegroups.com
I can fix the bug if Sammy can get me the algorithm.  I have similar code in one of my projects.

-- 
Rick C. Hodgin


--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/semware/003301d83540%24a01af550%24e050dff0%24%40ecarlo.nl.

Carlo Hogeveen

unread,
Mar 11, 2022, 7:38:48 AM3/11/22
to sem...@googlegroups.com

For context, these specific bugs have no priority on my behalf.

My interest here was in updating TSE’s documentation, which I have now done in the document I provided a link to.
https://ecarlo.nl/tse/files/TSE_Pro_Undocumented_Features.html#GetKeyFlags

Carlo



knud van eeden

unread,
Mar 11, 2022, 7:44:30 AM3/11/22
to sem...@googlegroups.com
CONSTANT                DOCUMENTED    DEFINED   WHEN KEY
                             VALUE      VALUE    PRESSED
_RIGHT_SHIFT_KEY_                1         16         16
_LEFT_SHIFT_KEY_                 2         16         16
_CTRL_KEY_                       4         12          8
_ALT_KEY_                        8          3          2
_SCROLL_LOCK_DEPRESSED_         16         64         64
_NUM_LOCK_DEPRESSED_            32         32         32
_CAPS_LOCK_DEPRESSED_           64        128        128
_INSERT_DEPRESSED_             128          0          0


So if interpreted correctly is the only correct entry

_NUM_LOCK_DEPRESSED_            32         32         32

and all the others are basically not as expected?

with friendly greetings
Knud van Eeden


--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/semware/004801d83544%24f29244b0%24d7b6ce10%24%40ecarlo.nl.

C.H. Fred

unread,
Mar 11, 2022, 11:41:39 AM3/11/22
to sem...@googlegroups.com
Sammy,

If you want to share the source code for this function, and the defines for those constants, I will send back changes that work in Windows and Linux.

-- 
Rick C. Hodgin


--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.

S.E. Mitchell

unread,
Mar 12, 2022, 9:57:46 AM3/12/22
to TSEPro Support
Sadly, that function is tightly integrated with all the keyboard code.
And the code is a mess.
Originally for Dos, then a half-baked attempt to port to OS/2, then a
port to Windows Console, and then to Windows GUI, and finally Linux.
Never really went back and cleaned it up.

I still plan to post all the code eventually, but there is lots of
work to be done.
--
Sammy Mitchell
> To view this discussion on the web visit https://groups.google.com/d/msgid/semware/CAOtq5xod5ceq8gyTAAfNLyjBCHjHn527cJg9P%3D5kEZ6W6a4chw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages