getcursorpos.pl
来自「WIN32::API for perl dev 5」· PL 代码 · 共 21 行
PL
21 行
use Win32::API;
Win32::API::Struct->typedef( POINT => qw(
LONG x;
LONG y;
) );
Win32::API->Import( 'user32' => 'BOOL GetCursorPos(LPPOINT pt)' );
#### using OO semantics
my $pt = Win32::API::Struct->new( 'POINT' );
GetCursorPos($pt) or die "GetCursorPos failed: $^E";
print "Cursor is at: $pt->{x}, $pt->{y}\n";
#### using tie semantics
my %pt;
tie %pt, Win32::API::Struct => 'POINT';
GetCursorPos(\%pt) or die "GetCursorPos failed: $^E";
print "Cursor is at: $pt{x}, $pt{y}\n";
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?