Mbee Posted June 30, 2014 Share Posted June 30, 2014 I've got a third-party video recording app idling away in the system tray (as it should be), just waiting for a hotkey command sequence (e.g., "CTRL+R") to begin recording. When I'm recording manually, I simply press the command sequence on the keyboard to get it going, without having to manually activate/raise the idling process/window. Using ControlSend() doesn't work, because there's no way to identify any specific control to use as a target. Using Send() doesn't work, because activating the video recording app changes the mode such that it ignores the hotkey. Instead, it's a hotkey situation with universal (system-wide) scope. The third-party app must do something like register a hotkey system-wide in Windows and wait in the system tray until some part of the operating system recognizes that the hotkey has been pressed and triggers the app to start recording. But, how do I submit the control sequence such that it activates the universal hotkey? My googling has only found AutoIt posts relating to setting up and working with internal hotkeys within a given AutoIt script, and nothing about how to trigger an external, system-wide hotkey. Or perhaps there's some way of making it look to the OS as a whole that the sequence was actually typed on the keyboard? I'm stumped! Please advise. Link to comment Share on other sites More sharing options...
Bert Posted June 30, 2014 Share Posted June 30, 2014 is there menu when you click on the tray item? If yes, then simply use the tray commands to send the command you need. Look in the helpfile The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Mbee Posted June 30, 2014 Author Share Posted June 30, 2014 Thanks. I may do it that way if all else fails, but I'd still like to know a more general answer. is there menu when you click on the tray item? If yes, then simply use the tray commands to send the command you need. Look in the helpfile Link to comment Share on other sites More sharing options...
Terenz Posted June 30, 2014 Share Posted June 30, 2014 Is possible to know the name, a link of the "third-party video recording app idling away in the system tray"? Send() work in many scenario but if "we" need to find an alternative how can test it if it really work for that "third-party video recording app"? Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Mbee Posted June 30, 2014 Author Share Posted June 30, 2014 (edited) Thanks for your reply, Terenz. But as I said above, I do not want a highly-specific answer for this particular app. I definitely want to know how to trigger a system-wide hotkey, not just for this particular instance. Because I already know of other system-wide hotkeys I want to trigger for other apps, apps that will not be in the system tray, as well as hotkeys that will not be associated with any specific app at all. During my googling, I've seen references to code in other languages that claims that there's some way to send keys directly to the keyboard driver such that the system absolutely cannot tell the difference between getting the key string programmatically versus having the user actually type the keys into the keyboard. That sounds like the most promising approach of all. Is possible to know the name, a link of the "third-party video recording app idling away in the system tray"? Send() work in many scenario but if "we" need to find an alternative how can test it if it really work for that "third-party video recording app"? Edited June 30, 2014 by Mbee Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 30, 2014 Moderators Share Posted June 30, 2014 Mbee,A simple Send command triggers system hotkeys on my system. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Terenz Posted June 30, 2014 Share Posted June 30, 2014 Thanks for your reply, Terenz. But as I said above, I do not want a highly-specific answer for this particular app. I definitely want to know how to trigger a system-wide hotkey, not just for this particular instance. I have already say ( and Melba23 confirm it ) Send() work in many scenario and i don't have nothing on my system that "avoid" or "ignore" the Send() command so for me ( i don't know for other ) without test with something that don't accept-ignore the Send() command is impossible to give an answer. Good Luck Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Mbee Posted July 1, 2014 Author Share Posted July 1, 2014 (edited) I'm honored by your visit, Melba23! Please accept my tremendous thanks for all the spectacular work you've gifted us with! Back on point, as soon as I understood the nature of my problems with using SendControl(), I then immediately tried Send(), as you suggest. The hotkey sequence is Control-R, and this is the very trivial code I tried: Send("^R") But nothing whatsoever happens! If I actually type that in on the keyboard, it works perfectly however. Perhaps it has something to do with the fact that the help file states that Send() "Sends simulated keystrokes to the active window", which in my case is the Explorer desktop (or some other app)? Note that I cannot make the video recording app the active window, since doing that changes the mode of the app into not-ready-to-record. [ETA: It doesn't work with some other system-wide hotkeys I've set either, such as those I created with QuicKeys. FYI, I'm running 64-bit Windows 7 Pro/SP1] Mbee, A simple Send command triggers system hotkeys on my system. M23 Edited July 1, 2014 by Mbee Link to comment Share on other sites More sharing options...
Solution somdcomputerguy Posted July 1, 2014 Solution Share Posted July 1, 2014 Try it with a lowercase r, in the Send. Mbee 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Mbee Posted July 1, 2014 Author Share Posted July 1, 2014 Aach! I didn't think of that, yet it worked perfectly!! I will now count you too, kind somdcomputerguy, as another The reason I didn't consider using lower-case is that, since AutoIt uses the "+" character to indicate that the hotkey sequence includes pressing the Shift key -- and the desired sequence does not include a Shift keypress -- the case wouldn't matter. That's what I get for abstract reasoning! Try it with a lowercase r, in the Send. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 1, 2014 Share Posted July 1, 2014 Using uppercase vs. lowercase to resolve an issue is something I've seen mentioned more than once by others in this forum. Whenever I've seen a post like that, and it did resolve whatever the issue was, I've always thought to myself, "something like that is so logical, but I wouldn't of thought of it".. I just made that post before one of the real AutoIt gurus did.. I'm glad you got it working! Mbee 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Mbee Posted July 1, 2014 Author Share Posted July 1, 2014 (edited) Not only do I want to thank you for providing the answer I so desperately needed, friend somdcomputerguy, but I want to also thank you for your persistence in helping me out both here and in that previous thread! (p.s., I also fixed the "correct answer" to point at your post, instead of mine! oops) Using uppercase vs. lowercase to resolve an issue is something I've seen mentioned more than once by others in this forum. Whenever I've seen a post like that, and it did resolve whatever the issue was, I've always thought to myself, "something like that is so logical, but I wouldn't of thought of it".. I just made that post before one of the real AutoIt gurus did.. I'm glad you got it working! Edited July 1, 2014 by Mbee Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 1, 2014 Share Posted July 1, 2014 (edited) Oh I've been using AutoIt for almost 10 years now, and I have 3 or 4 or 5 scripts that I use quite a bit for myself, use 1 or 2 or 3 written by others here, and have 1 or 2 that I have compiled and distributed to a small handful of people. My AutoIt knowledge is very basic and when I can help somebody out on this forum, I get a warm, fuzzy feeling in my gut! Edited July 1, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now