2 hours ago, Stefan said:
Seems @Michael Steil was way ahead of us.
After further studying of the Kernal sources I noticed the function "kbdbuf_get_modifiers" in kernal/kbdbuf.s.
In R38 the call address is $ca64.
I've just tested it briefly, and I think it is working properly. The function returns value of shflag in A register, where each modifier key is represented by one bit. This also makes it possible to detect combinations of several modifier keys.
Great! There's a Github issue I can take down as resolved, once I get caught up on my grading backlog (half of my courses do their final exams this week, so next week I am down from sixteen hours of lectures a week to eight).