Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Simulate Key stroke, such as <Printscreen>

by benlaw (Scribe)
on Nov 27, 2005 at 23:02 UTC ( [id://512083]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

benlaw has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'd like to write a Win32 program which can simulate key press, such as <Printscreen>, <insert>, <F1>, <Shift>+<4>, I want to print a screen shot then save as file.

Thanks a lot

p.s. seems I need 'cl' when install Image::Magick module http://search.cpan.org/~jcristy/PerlMagick-6.24/Magick.pm

I search solution b4, it seems i need to install Visual C++, it there any method rather than install Viusal C++? Thanks a lot

  • Comment on Simulate Key stroke, such as <Printscreen>

Replies are listed 'Best First'.
Re: Simulate Key stroke, such as <Printscreen>
by GrandFather (Saint) on Nov 27, 2005 at 23:20 UTC

    WRT ImageMagick. Install it useing the Windows download from http://www.imagemagick.org/script/binary-releases.php. Look for the Windows binary releases toward the bottom of the page. During the install let the installer know that you want the Perl API set up for you.


    DWIM is Perl's answer to Gödel
Re: Simulate Key stroke, such as <Printscreen>
by Albannach (Monsignor) on Nov 27, 2005 at 23:28 UTC
    For simulating keypresses, try win32::guitest

    Update: Certainly bart is correct, but strangely enough CPAN will still find Win32::GuiTest. My apologies to anyone troubled by the incorrect capitalization in my response above.

    --
    I'd like to be able to assign to an luser

      Even on Windows, case matters. It's Win32::GuiTest, not "win32::guitest".
Re: Simulate Key stroke, such as <Printscreen>
by gube (Parson) on Nov 28, 2005 at 00:17 UTC
Re: Simulate Key stroke, such as <Printscreen>
by jmcnamara (Monsignor) on Nov 28, 2005 at 03:53 UTC
Re: Simulate Key stroke, such as <Printscreen>
by zentara (Cardinal) on Nov 28, 2005 at 08:13 UTC
Re: Simulate Key stroke, such as <Printscreen>
by benlaw (Scribe) on Nov 28, 2005 at 09:05 UTC
    That's great , I try to install Win32::Screenshot but encounterred 'cl' missing problem~, that's great i solve the problem thanks all

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://512083]
Approved by GrandFather
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.