win32-shortkeys-kbh Code
Perl extension for hooking the keyboard on Windows
Brought to you by:
frappaz
| File | Date | Author | Commit |
|---|---|---|---|
| example | 2017-10-26 |
|
[51a097] Added example/example.pl |
| lib | 2017-10-27 |
|
[9ddcc1] use blib removed |
| t | 2017-10-03 |
|
[a1101a] Added files |
| Changes | 2017-10-03 |
|
[a1101a] Added files |
| INSTALL | 2017-11-07 |
|
[c544c8] memory leaks corrected |
| Kbh.xs | 2017-10-26 |
|
[07aad7] A lot of change commited before going on source... |
| MANIFEST | 2017-10-27 |
|
[7e5149] new makefile |
| Makefile | 2017-10-27 |
|
[7e5149] new makefile |
| Makefile.PL | 2017-10-03 |
|
[a1101a] Added files |
| README | 2017-11-07 |
|
[c544c8] memory leaks corrected |
| hook.c | 2017-11-07 |
|
[c544c8] memory leaks corrected |
| hook.h | 2017-10-26 |
|
[07aad7] A lot of change commited before going on source... |
| ppport.h | 2017-10-03 |
|
[a1101a] Added files |
| send_string.h | 2017-10-03 |
|
[a1101a] Added files |
| typemap | 2017-10-03 |
|
[a1101a] Added files |
NAME
Win32::Shortkeys::Kbh - Perl extension for hooking the keyboard on
windows
VERSION
0.01
INSTALLATION
To install Win32::Shortkeys::Kbh, cd to the directory that contains
this file and type the following:
perl Makefile.PL
make
make test
make install
On windows use nmake or dmake instead of make.
To install this module into a specific directory, do: perl Makefile.PL
PREFIX=/name/of/the/directory ...the rest is the same...
Please also read the perlmodinstall man page, if available.
DEPENDENCIES
XS
C
DESCRIPTION
This module uses Win32 API fucntions to create a keyboard hook with
register_hook. A sub ref is pass to the hook with set_key_processor.
This sub is called on key press and key release. It receives the key
code and can react using seng_string or send_cmd.
If you run the code (also in example/example.pl) in the synopsis and if
you open the notepad any keys except the s will be print out normaly.
When the s key is relead the keyboard will print 'You hit the s key'.
F12 will terminate the script.
set_key_processor( $my_sub_ref )
The sub passed to this function received the following parameters
$cup
Indicates if the key is released ($cup > 0) or pressed ($cup == 0)
$code
The virtual key code of the key
$alt
Indicates if the alt key is pressed ($alt > 0) or not ($alt == 0)
$ext
Indicates ($ext == 1) if extended-key flag is set or not ($ext == 0).
Following ms windows documentation this flag is set if one of the
additional keys on the enhanced keyboard is used. The extended keys
consist of the ALT and CTRL keys on the right-hand side of the
keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and arrow keys
in the clusters to the left of the numeric keypad; the NUM LOCK key;
the BREAK (CTRL+PAUSE) key; the PRINT SCRN key; and the divide (/)
and ENTER keys in the numeric keypad.
register_hook
unregister_hook
msg_loop
calls this to prevent your script from leaving and use next function to
quit.
quit
send_cmd($how_much, $vk_code)
VK_CODE are exported by this module and can be use as constant in the
perl code.
send_string("bla")
C<register_hook>. Send string (C<send_string("bla")>or commands C<send_cmd(how_much, VK_TAB)> to the keyboard:
EXPORT
None by default.
EXPORT_OK
The following export tags are defined to import on request:
input for send_string send_cmd paste_from_clpb
hook for register_hook unregister_hook msg_loop set_key_processor qui
vkcode to import all the VK_CODE defined
all to import everything.
AUTHOR
François Rappaz <rappazf@gmail.com>
COPYRIGHT
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included
with this module.