I have the following problem: I can manage AltGr+F5 (RightAlt+F5) and all
keyboard events with OEM and NEM.
However I don't know how to catch the LeftAlt+F5 and similar.
Can anyone help me?
One solution I have would be to install a hook for one or more of the various keyboard messages that are available. These messages give you access to flags that give extended information, which could be used to determine if the ALT key is down. My suggestion would be to use the WM_SYSKEYDOWN message. Here is a very basic example:
use Data::Dump qw(dump);
use Win32::GUI qw();
use Win32::GUI::Constants qw(/^WM_/); #gets all WM_ message constants
my $win = Win32::GUI::Window->new(
-name => 'main',
-size => [320,240],);
dump \@_; #shows all parameters;
my($this,$wParam,$lParam,$type,$msgcode) = @_;
return unless $type == 0; #make sure message isn't WM_COMMAND or WM_NOTIFY
return unless $msgcode == WM_SYSKEYDOWN; #make sure message is WM_SYSKEYDOWN
This may be what you were looking for. Check out the Windows SDK documentation for more info about the various messages that could be used.
Hope this will help.
> From: wb@...
> To: perl-win32-gui-users@...
> Date: Sat, 30 May 2009 19:02:02 +0200
> Subject: [perl-win32-gui-users] How to catch keyboard event like LeftAlt+F5?
> I have the following problem: I can manage AltGr+F5 (RightAlt+F5) and all
> keyboard events with OEM and NEM.
> However I don't know how to catch the LeftAlt+F5 and similar.
> Can anyone help me?
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> Perl-Win32-GUI-Users mailing list
Looking for a place to rent, share or buy this winter? Find your next place with Ninemsn property