473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Capturing global input?

I'd like to accept mouse gestures and keyboard shortcuts as input to a
program. The nature of this program requires that these commands be
issued regardless of the currently active window. Here's the rub: I
need a platform-independent solution.

Java supports with its MouseInfo class, but I'd like a Python
equivalent without turning to Jython. Is this possible?

Thanks in advance.
Dec 6 '07 #1
3 1368
On Dec 6, 3:51 pm, nomihn0 <nomi...@gmail.comwrote:
I'd like to accept mouse gestures and keyboard shortcuts as input to a
program. The nature of this program requires that these commands be
issued regardless of the currently active window. Here's the rub: I
need a platform-independent solution.

Java supports with its MouseInfo class, but I'd like a Python
equivalent without turning to Jython. Is this possible?

Thanks in advance.
There is no cross-platform way to do that. You have to use whatever
interface the OS provides for that (e.g., Xlib events for X11). You
could probably write a platform independent way by testing the OS and
using the appropriate apis for that OS (assuming that there are python
modules like python-xlib for other OS). I wonder why you'd want to
though, if Java already provides a solution? If you don't want to muck
with Java syntax, what about Jython?

Regards,
Jordan
Dec 7 '07 #2
On Dec 6, 9:16 pm, MonkeeSage <MonkeeS...@gmail.comwrote:
On Dec 6, 3:51 pm, nomihn0 <nomi...@gmail.comwrote:
I'd like to accept mouse gestures and keyboard shortcuts as input to a
program. The nature of this program requires that these commands be
issued regardless of the currently active window. Here's the rub: I
need a platform-independent solution.
Java supports with its MouseInfo class, but I'd like a Python
equivalent without turning to Jython. Is this possible?
Thanks in advance.

There is no cross-platform way to do that. You have to use whatever
interface the OS provides for that (e.g., Xlib events for X11). You
could probably write a platform independent way by testing the OS and
using the appropriate apis for that OS (assuming that there are python
modules like python-xlib for other OS). I wonder why you'd want to
though, if Java already provides a solution? If you don't want to muck
with Java syntax, what about Jython?

Regards,
Jordan
Ps. I saw you said you didn't want Jython, but I can't see why.
Dec 7 '07 #3
Thanks to all, you were very helpful. I suppose I'll use Jython after
all.

On Dec 6, 10:17 pm, MonkeeSage <MonkeeS...@gmail.comwrote:
On Dec 6, 9:16 pm, MonkeeSage <MonkeeS...@gmail.comwrote:
On Dec 6, 3:51 pm, nomihn0 <nomi...@gmail.comwrote:
I'd like to accept mouse gestures and keyboard shortcuts as input to a
program. The nature of this program requires that these commands be
issued regardless of the currently active window. Here's the rub: I
need a platform-independent solution.
Java supports with its MouseInfo class, but I'd like a Python
equivalent without turning to Jython. Is this possible?
Thanks in advance.
There is no cross-platform way to do that. You have to use whatever
interface the OS provides for that (e.g., Xlib events for X11). You
could probably write a platform independent way by testing the OS and
using the appropriate apis for that OS (assuming that there are python
modules like python-xlib for other OS). I wonder why you'd want to
though, if Java already provides a solution? If you don't want to muck
with Java syntax, what about Jython?
Regards,
Jordan

Ps. I saw you said you didn't want Jython, but I can't see why.
Dec 10 '07 #4

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

Similar topics

5
by: lawrence | last post by:
I've this function, which is the method of a class. I'm posting the constructor of the class down below. For some reason, when I fill out a form and hit submit, I'm not getting any values. Can...
2
by: Dan | last post by:
A Newbie needs help! Is it possible, in PHP, to capture the resulting HTML of a submitted form returning from a server and incorporate that HTML into say a table, or some predefined layout? I...
15
by: Tony Gahlinger | last post by:
I'm using my browser (Mozilla/5.0 Linux i686 Gecko/20031007 Firebird/0.7) to do some client-side image processing. I want to capture the sequence of coordinates a user clicks on in xxx.jpg in the...
12
by: Sharad Gupta | last post by:
i have this problem of capturing the filename on the instance when onclick is activated in the <body> the function should catch the filename and display it. Second problem, i have to catch the...
6
by: Soha | last post by:
I'm a beginner in using javascript and i need a reply so urgent; i have a problem in using javascript with asp the problem is that i want to define a global variable and then change the value of it...
7
by: jerrygarciuh | last post by:
Hello, I have been playing with various Googled solutions for capturing the <Enter> key to suppress form submission. My first question is whether anyone has a script that works in all common...
33
by: Joerg Schuster | last post by:
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: <fl> get rid of this limitation! if...
9
by: Will Pittenger | last post by:
If I were writing a C++ program, I would write a mouse hook. Does C# and ..NET 1.1 have anything equivalent. If not, I suppose I will need to use the Win32 API. ---------- Will Pittenger...
10
by: Andrew | last post by:
Hi, I have a messagebox that pops up due to an event. I did it in javascript. ie. alert("Time's up. Assessment Ended"); I want to capture the OK and Cancel events of this alert messagebox. My...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.