473,768 Members | 8,596 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1383
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...@gma il.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...@gma il.comwrote:
On Dec 6, 9:16 pm, MonkeeSage <MonkeeS...@gma il.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
2922
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 someone tell me why? function getVar($var="password") { // 05-08-03 - the important thing about this function is it reverses
2
1719
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 am trying to incorporate the resulting HTML into a layout I have created in order to keep the look & feel of my site consistent, but the resulting page is a plain "cheesy" page.
15
7052
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 following html <a href="#"><IMG SRC="xxx.jpg" ISMAP></a> and save these to a file for later handling. The coordinates appear on the bottom left of the window as I move the mouse, so I know they're being passed around somehow, but I haven't...
12
15867
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 image name in the same fashion using =onclick showimage(this). Is this possible at at I have tried all combinations of document.getElementbyId(); document.getElementbyName(); document.getElementbyTagName();
6
3947
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 after clicking on a link which activate a function that changes the global variable. this variable i use as the value of a hidden field in a form. my problem is that the global variable dosen't change. this is the code i used to do this: ...
7
20371
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 browsers? The script bellow is IE only. It fails FF 1.0 and NN 7. Also, if I can trap the keypress I would like to use it to tab to the next tabindex.
33
5642
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 p.pattern.groups > 100: raise AssertionError( "sorry, but this version only supports 100 named groups"
9
5727
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 E-Mail: mailto:will.pittenger@verizon.net All mail filtered by Qurb (www.qurb.com)
10
6020
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 code is in C#/ASP.NET. TIA. Andrew.
0
9576
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
9407
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9961
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
8840
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...
0
6656
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
5283
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
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.