Sign in to follow this  
Followers 0
StoneCut

Create Global Key Commands ?

3 posts in this topic

#1 ·  Posted (edited)

Hi there,

I'm very new to AutoIT and was surprised how far I got with my utility in just one night. Excellent stuff, many thanks for it ! I've run into a brickwall with my project for now, unfortunately. Hopefully someone can help.

I made a GUI for a mix of applications that control and display status of a connected device. The GUI launches an SDL application which is a graphical display window and it also launches another command-line application at the same time. The command-line application acts as a remote control for the graphical display window (i can use arrow keys to navigate etc) and as transmitter/receiver for the data to the device. My problem is that I am hiding the command-line remote control window to make things pretty and the graphical SDL app or my GUI will usually have focus instead. The command-line application needs to have focus to accept the keystrokes, however.

So, how can I send keystrokes to the hidden command-line window so that my actual remote control will still work ? Also, I have a "fullscreen" mode for the SDL application and I was wondering how to the same thing in fullscreen since I can't give focus to the command-line window then, either, since I fear I'd be kicked out of fullscreen again, right ?

I'm sorry if these are really noobish questions but I didn't know how to phrase them any other way. Any help is greatly appreciated !

Edited by StoneCut

Share this post


Link to post
Share on other sites



Hi there,

I'm very new to AutoIT and was surprised how far I got with my utility in just one night. Excellent stuff, many thanks for it ! I've run into a brickwall with my project for now, unfortunately. Hopefully someone can help.

I made a GUI for a mix of applications that control and display status of a connected device. The GUI launches an SDL application which is a graphical display window and it also launches another command-line application at the same time. The command-line application acts as a remote control for the graphical display window (i can use arrow keys to navigate etc) and as transmitter/receiver for the data to the device. My problem is that I am hiding the command-line remote control window to make things pretty and the graphical SDL app or my GUI will usually have focus instead. The command-line application needs to have focus to accept the keystrokes, however.

So, how can I send keystrokes to the hidden command-line window so that my actual remote control will still work ? Also, I have a "fullscreen" mode for the SDL application and I was wondering how to the same thing in fullscreen since I can't give focus to the command-line window then, either, since I fear I'd be kicked out of fullscreen again, right ?

I'm sorry if these are really noobish questions but I didn't know how to phrase them any other way. Any help is greatly appreciated !

It's hard to tell if 'command-line' means an actual CMD.exe shell to you. If so, you should be able to try adding the $STDIN_CHILD parameter to the Run() line and use StdInWrite().

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

It's hard to tell if 'command-line' means an actual CMD.exe shell to you. If so, you should be able to try adding the $STDIN_CHILD parameter to the Run() line and use StdInWrite().

:)

Well, no :P Sorry. Many thanks for your reply, however !

It's about a non-gui cygwin ("dos") app called usbhostfs.exe that needs to get the keypresses passed. However, I have another SDL app called remotejoy.exe which can be run full-screen at the same time. I can maybe see a solution by creating some *global* keyboard shortcuts, then using WinActive to activate the usbhostfs.exe window on demand, "send" a key there and then unactivate it again.

Sort of like this:

WinActivate ("C:\Dokumente und Einstellungen\StoneCut\Desktop\RemoteJoySDL\PC\usbhostfs_pc.exe")
Send ("s")
WinActivate ("remotejoy.exe")

My issue, however, is that when I do this the SDL app remotejoy.exe looses focus and the screen collapses. Would I still be able to use "StdInWrite()" somehow ? Also, can you give me a quick pointer on how to set up system-wide Hotkeys for my project ?

Once I got all that finished I'll need to figure out how to pass Joystick input to usbhostfs.exe, too, but that is not of very great priority right now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0