Skip to content
⌘ NSIS Forum Archive

How to Send Keys with NSIS?

8 posts

Bernat#

How to Send Keys with NSIS?

Hello,

I use NSIS to compile launchers for portable applications and I want to simulate key strokes as done by:
AutoIt
Send("{TAB}")
or VBScript
WshShell.SendKeys ("{TAB}")
Is there some plugins or code to do this with NSIS?
Thanks in advance for answer.
Bernat#
@ Afrow UK
Thanks for your quick reply. I think that keybd_event is my solution and I will study your link.

@ Takhir
Thanks also for your quick reply. Your plugin is interesting for me because I want also send a string to an input field.

If I succeed in a script I will post in this topic.
Takhir#
Please note that for keybd_event() or SendInput() your application should 1) be detached from installer (use Exec, not ExecWait or nsExec); 2) be visible; 3) have keyboard focus (to be restored before every char). For last point you need window handle. May be I forgot something else...
Xokar#
Did anyone manage to get SendInput working?

I've attempted to write the code but it's coming back with error 87:

System::Call '*(i1,i9,i0,i1) i.R0'
System::Call "User32::SendInput(i1,iR0,i1)?e"
Pop $R1
Detailprint $R1
System::Free $R0

I'm trying to send a Tab.