Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Keyboard Events

Reply
Thread Tools

Keyboard Events

 
 
Gandalf
Guest
Posts: n/a
 
      05-26-2008
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 !
 
Reply With Quote
 
 
 
 
Mike Driscoll
Guest
Posts: n/a
 
      05-26-2008
On May 26, 2:06*pm, Gandalf <(E-Mail Removed)> wrote:
> 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
 
Reply With Quote
 
 
 
 
Gandalf
Guest
Posts: n/a
 
      05-26-2008
On May 26, 11:25 pm, Dennis Lee Bieber <(E-Mail Removed)> wrote:
> On Mon, 26 May 2008 12:06:02 -0700 (PDT), Gandalf <(E-Mail Removed)>
> 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
> (E-Mail Removed) (E-Mail Removed)
> HTTP://wlfraed.home.netcom.com/
> (Bestiaria Support Staff: (E-Mail Removed))
> HTTP://www.bestiaria.com/


Thanks!
Anyone know which library should i learn then?
 
Reply With Quote
 
Ivan Illarionov
Guest
Posts: n/a
 
      05-26-2008
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
 
Reply With Quote
 
Gandalf
Guest
Posts: n/a
 
      05-26-2008
On May 27, 12:00 am, Ivan Illarionov <(E-Mail Removed)>
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?
 
Reply With Quote
 
Ivan Illarionov
Guest
Posts: n/a
 
      05-26-2008
On Mon, 26 May 2008 15:18:00 -0700, Gandalf wrote:

> On May 27, 12:00 am, Ivan Illarionov <(E-Mail Removed)> 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?


Google is your friend
Some links with examples:
http://www.brunningonline.net/simon/...es/000652.html
http://aspn.activestate.com/ASPN/Coo.../Recipe/208699
 
Reply With Quote
 
Gandalf
Guest
Posts: n/a
 
      05-26-2008
On May 27, 12:18 am, Gandalf <(E-Mail Removed)> wrote:
> On May 27, 12:00 am, Ivan Illarionov <(E-Mail Removed)>
> 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!
 
Reply With Quote
 
Ivan Illarionov
Guest
Posts: n/a
 
      05-26-2008
On Mon, 26 May 2008 15:26:50 -0700, Gandalf wrote:

> On May 27, 12:18 am, Gandalf <(E-Mail Removed)> wrote:
>> On May 27, 12:00 am, Ivan Illarionov <(E-Mail Removed)> 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!


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
 
Reply With Quote
 
Mike Driscoll
Guest
Posts: n/a
 
      05-27-2008
On May 26, 5:38*pm, Ivan Illarionov <(E-Mail Removed)> wrote:
> On Mon, 26 May 2008 15:26:50 -0700, Gandalf wrote:
> > On May 27, 12:18 am, Gandalf <(E-Mail Removed)> wrote:
> >> On May 27, 12:00 am, Ivan Illarionov <(E-Mail Removed)> 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!

>
> 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
 
Reply With Quote
 
Gandalf
Guest
Posts: n/a
 
      05-27-2008
On May 27, 2:36 am, Mike Driscoll <(E-Mail Removed)> wrote:
> On May 26, 5:38 pm, Ivan Illarionov <(E-Mail Removed)> wrote:
>
>
>
> > On Mon, 26 May 2008 15:26:50 -0700, Gandalf wrote:
> > > On May 27, 12:18 am, Gandalf <(E-Mail Removed)> wrote:
> > >> On May 27, 12:00 am, Ivan Illarionov <(E-Mail Removed)> 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!

>
> > 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
keyboard and mouse events rogamuffin@yahoo.co.uk Java 2 02-07-2005 06:10 PM
Keyboard error or no keyboard present??? Bud Light Computer Support 2 01-22-2005 04:00 AM
Mouse&Keyboard Events ho0c1355@hal.humberc.on.ca Java 0 10-22-2003 07:54 PM
SWING keyboard events Haider Kazmi Java 2 07-18-2003 02:58 AM



Advertisments