473,810 Members | 3,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing my own typing monitor program for RSI sufferers...

Hi...

I want to write a program that will let me know after thirty minutes of
typing that I need to take a five minute typing break. But when I stop
typing it's smart enough to pause the 30 minute timer automatically.
This is under the X-Window System (Linux).

The tricky part is obviously knowing when the mouse and keyboard are
being used....especia lly when my application doesn't have the focus.

Obviously I can't do this with just the base python install. Is there
an add on library that I can use to monitor the keyboard and mouse?
Which is it? Maybe one of the graphical libraries, like wx, or qt, or
gtk? Which functions do I need?

Thanks

Feb 21 '06 #1
6 1544
>> I want to write a program that will let me know after thirty minutes
of typing that I need to take a five minute typing break. But when I
stop typing it's smart enough to pause the 30 minute timer
automatically. This is under the X-Window System (Linux).


Take a look at

http://sourceforge.net/projects/watch/

If you'd like to be added as a developer, let me know...

Skip
Feb 21 '06 #2
So, so close.... The problem with this implementation is that it
doesn't monitor usb keyboards under linux at all as far as I can
tell....since no keyboard entry will show up in /proc/interrupts with a
usb keyboard. I absolutely need the keyboard monitoring as well.

Otherwise, your project would be the perfect starting point for me!

Anyone else have an idea as to what I can use with Python to know when
the keyboard is being used even when I don't have focus?

Thanks
Sam

Feb 21 '06 #3
sa*******@gmail .com schrieb:
So, so close.... The problem with this implementation is that it
doesn't monitor usb keyboards under linux at all as far as I can
tell....since no keyboard entry will show up in /proc/interrupts with a
usb keyboard. I absolutely need the keyboard monitoring as well.

Otherwise, your project would be the perfect starting point for me!

Anyone else have an idea as to what I can use with Python to know when
the keyboard is being used even when I don't have focus?


If you can wait a few month, I'll be doing that in python based on this:

http://www.frogmouth.net/hid-doco/linux-hid.html

I'll be doing it for a art-project that is scheduled some months away. But I think the above information even should
help you get started on your own.

Diez
Feb 21 '06 #4
So, so close.... The problem with this implementation is that it
doesn't monitor usb keyboards under linux at all as far as I can
tell....since no keyboard entry will show up in /proc/interrupts with
a usb keyboard. I absolutely need the keyboard monitoring as well.


Sam's> Otherwise, your project would be the perfect starting point for me!

Hmmm... I'm confused. It is a starting point, just not one that monitors
USB keyboards. A "perfect" starting point would be one in which you didn't
need to make any changes. Why throw the baby out with the bath water? Why
not just rewrite check_linux_int errupts to somehow watch the usb keyboard as
well (however that might be done)? It's not going to be any more difficult
to check for USB keyboard interrupts in this project than in some other and
it already has a more-or-less functional user interface and support for
Windows.

Skip
Feb 21 '06 #5
Well, this is the one part that I have no idea how to do....as far as I
can tell the information simply is not in /proc. I need a different
method to discover when someone is typing. That's what I came to the
list for, to get a clue as to how to do that.

Certainly someone has an idea how to detect typing on a usb keyboard
under python....some external library must exist?

Thanks

p.s. Diez...I'll read that over, and will look forward to seeing what
you come up with. Please email me to let me know......I suspect that
your approach will require kernel modifications.. .. I don't want to go
down that path. I'd be okay with it once, cut the last thing I want to
do is repatch my ubuntu kernel every time there was a security fix.

Feb 21 '06 #6
sa*******@gmail .com wrote:
I want to write a program that will let me know after thirty minutes of
typing that I need to take a five minute typing break. But when I stop
typing it's smart enough to pause the 30 minute timer automatically.
This is under the X-Window System (Linux).

The tricky part is obviously knowing when the mouse and keyboard are
being used....especia lly when my application doesn't have the focus.

Obviously I can't do this with just the base python install. Is there
an add on library that I can use to monitor the keyboard and mouse?
Which is it? Maybe one of the graphical libraries, like wx, or qt, or
gtk? Which functions do I need?


You can do a bit of X hackery. Look for example at

http://www.softlab.ece.ntua.gr/~sivann/src/misc/xkey.c

which is a C program that prints keypresses (in any application). Should
be fairly easy to turn into a Python extension module to monitor X activity.

Cheers,

Carl Friedrich Bolz

Feb 22 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
3130
by: bearophileHUGS | last post by:
Adding Optional Static Typing to Python looks like a quite complex thing, but useful too: http://www.artima.com/weblogs/viewpost.jsp?thread=85551 I have just a couple of notes: Boo (http://boo.codehaus.org/) is a different language, but I like its "as" instead of ":" and "->", to have: def min(a as iterable(T)) as T: Instead of:
18
12740
by: Mad Programmer | last post by:
I'm writing a destructive trojan with C++ and I need to know how I can destroy the target's monitor and format the target's harddisk before the target can stop the program. What do I need to do?
2
3312
by: Jack David | last post by:
Using the code below I am able to monitor a single directory for a new file and then kick-off a process to deal with the file. The question is??? How would I modify this code to be able to monitor a couple of different directories and based upon the directory where the new file is created kick-off a process Example: File A in Directory B starts process C
6
1528
by: KK | last post by:
Dear All My requirement is to write class that is thread safe.( All public methods & static methods must be thread safe ). I found two options to implement this 1.using MethodImplOptions.Synchronized attribute 2.Using Lock statement Class using method 1: public class X {
4
2391
by: John | last post by:
I'd like to write a programme that runs on a PC with two monitors. The application would be used in a shop, with one monitor for shop assistant and the other for the customer. The two must show things independently, so the application can display certains things on one monitor (eg goods in the store) and certain other things on the other monitor (eg details of a certain product). Is this possible?
7
4370
by: mojtaba_danai | last post by:
Hi Hope that some one can help with the following. I wish to write a Visual C++ program, which monitors 3-4 other services (process/programs also written in VC++). The program shall monitor, if the other processes are alive and to see, if they are sending heartbeat messages. I wish to do this for exampel via socket programming. Can any one tell me, the structure og guideline for this?
2
2200
by: Luc The Perverse | last post by:
I am a Java programmer - but I have had some experience programming in C++ before (3 years on a job) I have need of an application or set of applications to do the following on a windows machine: 1 - Passively monitor CPU and HD utilization, and if they drop to 0, and X number of seconds have passed, request the OS (windows) use its time to cache some files which may be launched. (The files would be user selectable 2 - Watch for...
9
1722
by: bonk | last post by:
Does anyone have a simple example on how to prohibit that any thread other than the current thread modifies a certain object (a collection) while we are in a certain section of the code? In other words: while we are inside this codeblock whoever might think of modified that particular collection has to wait until we have left that codeblock. As far as I understand it lock() {} only prohibits that other threads enter a certain block of...
22
2726
by: JoeC | last post by:
I am working on another game project and it is comming along. It is an improvment over a previous version I wrote. I am trying to write better programs and often wonder how to get better at programming. I tend to learn what is useful and gets the job done. I am always curious if there is some techique I don't know. I read books and study as well as write programs. My goal is to some day be able to get a job programming. I have a...
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.