473,287 Members | 1,555 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,287 software developers and data experts.

Keyboard Events

I use WX on windows XP and I try to generate an event when the user is
clicking the keyboard while the application frame is not in focus.
All I manged to do were while the application frame is in focus
Can someone please show me how to do it?

Thanks !
Jun 27 '08 #1
9 3990
On May 26, 2:06*pm, Gandalf <goldn...@gmail.comwrote:
I use WX on windows XP and I try to generate an event when the user is
clicking the keyboard while the application frame is not in focus.
All I manged to do were while the application frame is in focus
Can someone please show me how to do it?

Thanks !
You can only catch the keyboard events for whichever widget is in
focus. So, if you have a text control, you'll need to bind to that.
The events you're likely need are EVT_KEYDOWN or EVT_CHAR. You cannot
catch keyboard events with wx if you are using MS Word. For that sort
of thing,you'll have to hook in at the OS level.

Mike
Jun 27 '08 #2
On May 26, 11:25 pm, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote:
On Mon, 26 May 2008 12:06:02 -0700 (PDT), Gandalf <goldn...@gmail.com>
declaimed the following in comp.lang.python:
I use WX on windows XP and I try to generate an event when the user is
clicking the keyboard while the application frame is not in focus.
All I manged to do were while the application frame is in focus
Can someone please show me how to do it?

I'm no expert, but I think normal operation is that the operating
system does not send events to an application unless that application
has the focus.

To counter that, though, there is no doubt some way to inform the OS
that an application is interested in all events, even those not meant
for it directly. As such a capability tends to be OS specific, it may
not be easily exposed. Under Windows, this probably requires getting a
handle on the "desktop window" and processing messages that it sees
(without failing to pass them on to whatever other windows are looking
for them)
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfr...@ix.netcom.com wulfr...@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-a...@bestiaria.com)
HTTP://www.bestiaria.com/
Thanks!
Anyone know which library should i learn then?
Jun 27 '08 #3
On Mon, 26 May 2008 14:40:18 -0700, Gandalf wrote:
Thanks!
Anyone know which library should i learn then?
Looks like you need to dive into Win32 API
http://msdn.microsoft.com/en-us/libr...44(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...30(VS.85).aspx
and others
combined with ctypes.

Ivan
Jun 27 '08 #4
On May 27, 12:00 am, Ivan Illarionov <ivan.illario...@gmail.com>
wrote:
On Mon, 26 May 2008 14:40:18 -0700, Gandalf wrote:
Thanks!
Anyone know which library should i learn then?

Looks like you need to dive into Win32 APIhttp://msdn.microsoft.com/en-us/library/ms697544(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/ms645530(VS.85).aspx
and others
combined with ctypes.

Ivan
well, that seems extremely valuable but how can i implement those
functions with python?
Jun 27 '08 #5
On Mon, 26 May 2008 15:18:00 -0700, Gandalf wrote:
On May 27, 12:00 am, Ivan Illarionov <ivan.illario...@gmail.comwrote:
>On Mon, 26 May 2008 14:40:18 -0700, Gandalf wrote:
Thanks!
Anyone know which library should i learn then?

Looks like you need to dive into Win32
APIhttp://msdn.microsoft.com/en-us/library/ms697544(VS.85).aspxhttp://
msdn.microsoft.com/en-us/library/ms645530(VS.85).aspx
>and others
combined with ctypes.

Ivan

well, that seems extremely valuable but how can i implement those
functions with python?
Google is your friend
Some links with examples:
http://www.brunningonline.net/simon/...es/000652.html
http://aspn.activestate.com/ASPN/Coo.../Recipe/208699
Jun 27 '08 #6
On May 27, 12:18 am, Gandalf <goldn...@gmail.comwrote:
On May 27, 12:00 am, Ivan Illarionov <ivan.illario...@gmail.com>
wrote:
On Mon, 26 May 2008 14:40:18 -0700, Gandalf wrote:
Thanks!
Anyone know which library should i learn then?
Looks like you need to dive into Win32 APIhttp://msdn.microsoft.com/en-us/library/ms697544(VS.85).aspxhttp://ms...
and others
combined with ctypes.
Ivan

well, that seems extremely valuable but how can i implement those
functions with python?
You know what I'm sorry, I will try to understand the ctypes lib
before bothering you.

thank you all!
Jun 27 '08 #7
On Mon, 26 May 2008 15:26:50 -0700, Gandalf wrote:
On May 27, 12:18 am, Gandalf <goldn...@gmail.comwrote:
>On May 27, 12:00 am, Ivan Illarionov <ivan.illario...@gmail.comwrote:
On Mon, 26 May 2008 14:40:18 -0700, Gandalf wrote:
Thanks!
Anyone know which library should i learn then?
Looks like you need to dive into Win32
APIhttp://msdn.microsoft.com/en-us/library/ms697544
(VS.85).aspxhttp://ms...
and others
combined with ctypes.
Ivan

well, that seems extremely valuable but how can i implement those
functions with python?

You know what I'm sorry, I will try to understand the ctypes lib before
bothering you.

thank you all!
No need to sorry. I have actually found very valuable information at
http://www.brunningonline.net/simon/...es/000652.html
while googling to answer your question. I didn't know that such things
are really possible with Python/Win32! It'll help me a lot. Thank you!

Ivan
Jun 27 '08 #8
On May 26, 5:38*pm, Ivan Illarionov <ivan.illario...@gmail.comwrote:
On Mon, 26 May 2008 15:26:50 -0700, Gandalf wrote:
On May 27, 12:18 am, Gandalf <goldn...@gmail.comwrote:
On May 27, 12:00 am, Ivan Illarionov <ivan.illario...@gmail.comwrote:
On Mon, 26 May 2008 14:40:18 -0700, Gandalf wrote:
Thanks!
Anyone know which library should i learn then?
Looks like you need to dive into Win32
APIhttp://msdn.microsoft.com/en-us/library/ms697544

(VS.85).aspxhttp://ms...
and others
combined with ctypes.
Ivan
well, that seems extremely valuable but how can i implement those
functions with python?
You know what I'm sorry, I will try to understand the ctypes lib before
bothering you.
thank you all!

No need to sorry. I have actually found very valuable information athttp://www.brunningonline.net/simon/blog/archives/000652.html
while googling to answer your question. I didn't know that such things
are really possible with Python/Win32! It'll help me a lot. Thank you!

Ivan
If you guys are going to go digging into the PyWin32 modules, make
sure you check this site out:

http://aspn.activestate.com/ASPN/doc...2/PyWin32.html

It has the docs for the distro and a link to the user's group too. Bot
have been very helpful to me.

Mike
Jun 27 '08 #9
On May 27, 2:36 am, Mike Driscoll <kyoso...@gmail.comwrote:
On May 26, 5:38 pm, Ivan Illarionov <ivan.illario...@gmail.comwrote:
On Mon, 26 May 2008 15:26:50 -0700, Gandalf wrote:
On May 27, 12:18 am, Gandalf <goldn...@gmail.comwrote:
>On May 27, 12:00 am, Ivan Illarionov <ivan.illario...@gmail.comwrote:
On Mon, 26 May 2008 14:40:18 -0700, Gandalf wrote:
Thanks!
Anyone know which library should i learn then?
Looks like you need to dive into Win32
APIhttp://msdn.microsoft.com/en-us/library/ms697544
(VS.85).aspxhttp://ms...
and others
combined with ctypes.
Ivan
>well, that seems extremely valuable but how can i implement those
>functions with python?
You know what I'm sorry, I will try to understand the ctypes lib before
bothering you.
thank you all!
No need to sorry. I have actually found very valuable information athttp://www.brunningonline.net/simon/blog/archives/000652.html
while googling to answer your question. I didn't know that such things
are really possible with Python/Win32! It'll help me a lot. Thank you!
Ivan

If you guys are going to go digging into the PyWin32 modules, make
sure you check this site out:

http://aspn.activestate.com/ASPN/doc...pywin32/PyWin3...

It has the docs for the distro and a link to the user's group too. Bot
have been very helpful to me.

Mike
OK thanks guys I'm going try and if I will succeed I will tel you how
I did it
Jun 27 '08 #10

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

Similar topics

2
by: Patricio Stegmann | last post by:
Hello, I'm trying to capture all keyboard events from some different web page layouts: framesets with different stuff, like flash or whatever ! The problem I am getting is that only focused...
9
by: Marek Mand | last post by:
How to use generated keyboard events? What I am trying here to do is in onkeyup event handler http://www.hot.ee/idaliiga/braggart/createEventTest.htm generate a (shift)TAB keydown so the...
3
by: Lachlan Hunt | last post by:
Hi, I've been looking up lots of documentation and trying to work out a cross-platform method of capturing a keyboard event and working out which key was pressed. From what I can find, there...
2
by: wesmanjunk | last post by:
does anyone know how to generate keyboard events in another application? like public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); can be used for mouse...
0
by: luc.saffre | last post by:
Hello, I thought that I should ask here for comments on a blog entry that I wrote some weeks ago. I am sure that other people have been thinking about this, but I didn't yet find them. The...
16
by: dfaber | last post by:
Hi all, I have been searching for a keyboard and mouse tracker on linux. I've read solutions (watch at sourceforge) which look at /proc/interrupts to check keyboard or mouse activity. I also read...
0
by: Gamey | last post by:
I have an application that NEEDS (don't ask) to handle additional mouse and keyboard processing during DoDragDrop. Normally, DoDragDrop kindly squashes all keyboard and mouse events. Alternate,...
12
by: =?ISO-8859-1?Q?Joaqu=EDn_Zuazo?= | last post by:
I'm trying to find what character was pressed, using an accent with a dead letter, e.g an á, on an input box. I have made an small program to check the keyboard events keydown, keypress and...
13
by: andypb123 | last post by:
Hello, The onchange event fires in IE6 in a SELECT element when scrolling through the list with the up and down arrows on the keyboard. In Firefox it only fires after you hit the enter key, which...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.