ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Simple Commandline to send Keystrokes (WinSendKeys)

(1/9) > >>

Split_e:
This is continued from https://www.donationcoder.com/forum/index.php?topic=25388

I'm looking to use Screen Captor to basically screen cap every page of a book; the book software navigates to the next page via the Right Arrow key or Page Up key. Screen Captor can do the whole process, but only if I give it a proper commandline to invoke. So that brings me here.

Just looking for a couple of lines of code that I can plug into Screen Captor (in post-capture commandline option) to hit one key (either right arrow or page up) once. Thanks a ton in advance!

mouser:
so just to refine your request,

what you are looking for is a commandline tool that can send arbitrary keys (like right arrow, pageup, etc.) to the last active window, or optionally to a window specified by title/class/applicationexefilename.

rjbull:
Why does it have to be command line?  There's some reason you can't use a macro program like Macro Express or PowerPro?

mouser:
it has to be a commandline utility because he's going to launch it from another program when it needs to be run.

rjbull:
Looks like NirCmd might be able to do it.  At least, it has "sendkey" type commands, but it doesn't seem to specify a target program or window.

Also looks like AutoHotKey may be able to read text from a file and type it as keystrokes to a program, or, maybe you can use Windows Scripting Host.  However, most of the Google hits appear to refer to sending keystrokes to a command window, not getting them from it.

Navigation

[0] Message Index

[#] Next page

Go to full version