There are a bunch of programs out there for people with hand
problems. These programs essentially keep track of your
typing/mousing habits and make sure every 30 minutes or so you take a
break, by popping up on your screen for five minutes and locking your
keyboard.
I’ve used pretty much every one of these programs available for
Linux: gnome-typing-monitor, xwrits, workrave, etc. But
none are perfect for me…so I’d like to write my own.
I’m pretty good with python, but don’t know wx at all. Although
I’m willing to put in the time to learn it. First though I’d like
to confirm that it’s the proper tool for the job.
From what I can tell there are only two tricky parts…
I need to be able to keep track of when the keyboard and mouse
are being used even when my application does not have the focus.
When the break comes I need to be able to grab focus, and keep
it for a predetermined length of time, no matter what key combinations
the user tries to switch to something else.
Is wxpython the right tool for this job? Which functions/methods/etc. should I look at to accomplish this?
If it’s not the right tool, what Python toolkit should I use?
There are a bunch of programs out there for people with hand problems. These programs essentially keep track of your typing/mousing habits and make sure every 30 minutes or so you take a break, by popping up on your screen for five minutes and locking your keyboard.
I've used pretty much every one of these programs available for Linux: gnome-typing-monitor, xwrits, workrave, etc. But none are perfect for me....so I'd like to write my own.
I'm pretty good with python, but don't know wx at all. Although I'm willing to put in the time to learn it. First though I'd like to confirm that it's the proper tool for the job.
>From what I can tell there are only two tricky parts....
1) I need to be able to keep track of when the keyboard and mouse are being used even when my application does not have the focus.
The mouse is doable, you can periodically poll with wx.GetMousePosition. The keyboard probably isn't doable from wxPython though, as you'll need some platform specific code to hook into the system event queues.
2) When the break comes I need to be able to grab focus, and keep it for a predetermined length of time, no matter what key combinations the user tries to switch to something else.
This may have the same problem, as wxPython respects the platform's or Window Manager's policies regarding whether windows can pop on top of other applications. However with the right combinations of flags you may be able to create and show a frame full screen (use frame.ShowFullScreen) and then capture the mouse for the timeout period.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!