Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 19th March 2008, 10:31   #1
Bernat
Junior Member
 
Join Date: Mar 2008
Location: France
Posts: 2
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
code:
Send("{TAB}")

or VBScript
code:
WshShell.SendKeys ("{TAB}")

Is there some plugins or code to do this with NSIS?
Thanks in advance for answer.
Bernat is offline   Reply With Quote
Old 19th March 2008, 11:47   #2
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
For pre-defined stdin string http://nsis.sourceforge.net/ExecCmd_plug-in may help
Takhir is offline   Reply With Quote
Old 19th March 2008, 18:12   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
Simplest solution is invoke keybd_event with System plug-in.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 19th March 2008, 18:39   #4
Bernat
Junior Member
 
Join Date: Mar 2008
Location: France
Posts: 2
@ 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.
Bernat is offline   Reply With Quote
Old 20th March 2008, 07:22   #5
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
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...
Takhir is offline   Reply With Quote
Old 10th July 2009, 15:25   #6
Xokar
Junior Member
 
Join Date: Jun 2008
Location: UK
Posts: 9
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.
Xokar is offline   Reply With Quote
Old 10th July 2009, 16:21   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
Use keybd_event. Easier to implement and it should still work on Vista.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 11th July 2009, 13:02   #8
Xokar
Junior Member
 
Join Date: Jun 2008
Location: UK
Posts: 9
Unfortunately keybd_event doesn't work with TS RemoteApps, I desperately need SendInput.
Xokar is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump