ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > LaunchBar Commander

Can't get Sendkeys to work

(1/2) > >>

kimbriki:
Hi,
I have a program that has a few hotkeys that I am wanting Launchbar Commander to initiate, however, I can't get them to work.
For example, one hotkey is CTL SHIFT B, when I put the sendkey into LBC, as '^+b' (without quotes) a 'B' comes out, not the result of the hotkey, or if I try '+^b' still only the 'b'
What could I be doing wrong? (I am not using the numpad for this)

IainB:
@kimbriki: Presumably, you want CTL+SHIFT+B to be sent to simulate a single simultaneous hotkey depression, right?
I am not familiar with using sendkey in LBC, but from the Help file it seems that keys are sent sequentially, which, if true, could explain why you see the output as "b" in both the cases you give above.

kimbriki:
Yes, I do want CTL+SHIFT+B, and as you say, this is not happening as a simultaneous key press, but appears to be sequential - how do I get the keys sent simultaneously?

mouser:
maybe try ^(+(b))

IainB:
@mouser:
maybe try ^(+(b))
-mouser (September 21, 2018, 09:48 PM)
--- End quote ---
Ahh. The penny just dropped.
Thanks for that. It helps solve a bit of a puzzle for me. I had been meaning to go back and read the rest of the LBC Help file about this, as it had been niggling away at the back of my mind. I mean, if I had been wanting to do the same thing as @kimbriki seemed to be wanting to do, then how might I go about it? I didn't actually want to do it and couldn't immediately see "why" (i.e., the user requirement) for his wanting to do it, as I thought that, if it was me, then I would usually use AHK (AutoHotkey) to do send a text string or hotkey and did not see that LBC was necessarily the "right" tool for that job. However, after reading the rest of that page of the Help file, I think I see that LBC may have other potential uses extending beyond the obvious and that I had not considered - e.g. (say), it could be used to invoke AHK functions - effectively as subroutines - opening the way to the possibility of providing a higher level of automation (which I am usually all in favour of).
This had been a minor puzzle for me  - one that I had been idly wondering about in the first place, in my exploratory use of LBC.
I looked in the Help file for something that seemed relevant to what you had written (above). This was the bit that caused me to think:
(Text partially copied below, with my emphasis.)
Sendkeys Documentation
 ...
Special strings that you can use in a {sendkeys} clip, from the TPushKeys help file:

Function key definitions are enclosed within braces, keys from F1 to F24 are represented by:
{F1}...{F24}
 
State Modifiers
Shift Key                +
Ctrl Key                        ^
Left Alt Key                %
Right Alt Key (Alt Gr)        !

Prefix any key definition with the appropriate modifier to affect the key press immediately following it e.g. +ab will result in the key strokes Ab being directed to the application.

To extend the modifier to affect a group of characters enclose them in parentheses e.g  !(ab) will result in AB being simulated. Parentheses may be nested so that !(+(ao)) will give ÁÓ.

Note: State Modifiers need not be used with standard keys as they can be entered directly. See example

IMPORTANT: When you want to trigger normal letter keys in combination with Ctrl Alt Shift, you *MUST* use lowercase versions of the letters, or a SHIFT key will be simulated.

To simulate the press and release of a modifier key then the key symbol must be the only character in the Keys string. See example ...

...(there's more).
__________________________________________
This new functionality is provided by the TPushKeys component by Alan Warriner which encapsulates, and extends, Christopher Latta's PushKeys code ([email protected], www.alan-warriner.co.uk)

--- End quote ---
I think I now better understand why you embedded TPushKeys functionality in LBC.
Seems pretty nifty.

Navigation

[0] Message Index

[#] Next page

Go to full version