TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: R.WIESER
date: 2020-02-18 11:18:00
subject: Re: Starting a Python scr

Dennis,

> Okay... I couldn't get wx.KeyboardState() to do anything desirable.
> It acted more like a way to SET modifier state!

Thank you for having tested it.   I'm quite hesitant to just install "stuff"
to see if something works (and if not just have it weighing-down the
'puter).

> BUT... I stumbled onto a wx.GetKeyState(key)

Thanks for finding that one.  And with your test it proves to work too. :-)

In between I search for some way to just check the keyboard state on Linux
(as that in itself already seemed to be a problem), and stumbled over the
next:

https://stackoverflow.com/questions/3649874/how-can-i-get-the-keyboard-state-in
-linux
(notice the last entry, using gtk/gdk)

... but while testing that (it works btw) I stumbled over something I did
not consider: Both the SHIFT as well as the CTRL keys are modifiers when
selecting (a range of) files.

I found that out when SHIFT-doubleclicking the Python script itself, and
seeing a number of scripts opened (luckily in texteditors, as I have set
that as the default action).    The same (ofcourse) happens for shortcuts on
the desktop.

In other words, using either the SHIFT or CTRL modifier keys is just waiting
for something bad to happen. :-((

I've just tried also the left "windows" key, and although that works you
need to push it twice, as the first time drops the system menu.   The right
one works OK, but isn't all that handy for a right-handed person.   NUMLOCK
and CAPSLOCK also seem to work, but as those are toggle keys ...

Moving back a bit I tried to search for a "regular" key that I could perhaps
use, but although the ESC key doesn't do anything wierd at the time I click
the C++ program, it directly closes any dialog the program displays (which I
used to display the contents of "button_state").

Man, I really hate it when the OS is laughing in my face. :-)

Do you perhaps have any ideas ?

Regards,
Rudy Wieser

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.