This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Hotkey action trigger loop
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

lujomu

9 Posts

Posted - 05/24/2013 :  15:17:50  Show Profile
Hi!

I'd like to define the hotkey [Ctrl]+[Shift]+V for a specific application that alters the clipboard content and then pastes it. For all other applications the original hotkey key combination should be simply passed on.

So far I have come up with the following Lua script:
winHand = acGetForegroundWindow()
winTitle = acGetWindowTitle( winHand)

if winTitle:sub( 1, 6) == "StatET" then
	cbText = acGetClipboardText()
	acSetClipboardText( cbText:gsub("%\\[%\\]?", "/"))
	acSendKeys( "^v")
	acSetClipboardText( cbText)
else
	acSendKeys( "^+v")
end
For that "StatET" application it is indeed working as intended, but for every other application the hotkey obviously seems to trigger itself in a loop and so the orginial key combination is never passed on to the actual application!

Is there a way to prevent this loop, e.g. another way to restrict that hotkey to a specific application?

Cheers!

Rob

USA
2615 Posts

Posted - 05/24/2013 :  15:53:06  Show Profile  Visit Rob's Homepage
Hmm, so far I can't think of a way to accomplish this, other than crafting custom windows messages (which will be a pain, inconsistent between apps, and probably not be worth the trouble).

Will keep thinking about it.
Go to Top of Page

lujomu

9 Posts

Posted - 05/24/2013 :  16:23:17  Show Profile
Ahh, don't bother, it's not that important. Just thought there might be an easy way to accomplish this.

It would probably need a function that suspends the hotkey evaluation, analogous to acDisableCapture()/acEnableCapture().

I'll just change the hotkey for now.

Edited by - lujomu on 05/24/2013 16:23:29
Go to Top of Page

Rob

USA
2615 Posts

Posted - 05/24/2013 :  16:25:42  Show Profile  Visit Rob's Homepage
Right, and there's nothing currently in the code which would handle that scenario. Will keep it in mind for future development, though
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000