Some typing / key pressing issues with and without modifiers

When you say "pauses", it implies programmed pauses. Do you mean you just want hitting the key once to simulate ⌥Tab?

  • Which macro that I posted are referring to?
  • Please state clearly what you are trying to do. You never mentioned a "second key" before.

Now it's getting even worse "understanding-wise".... :grin:

Just reset everything I tried to describe in your mind and just think how you use the CMD-Tab for selecting one out of several running apps on the Mac ! Which means holding CMD, then Tab one or multiple times in order to find the app you want to address/make active and then release CMD in order to finish the process. THAT's exactly what I want to accomplish using two keys on my USB device....

This:

might be a more advanced example of a task I'd really find interesting digging into someday.

Do you mean you want to specify the app as part of the macro?

If so, use the Activate a Specific Application action:

If you want your key to just trigger ⌘Tab, then:

You do NOT have to hold the modifier separately. If the above does not satisfy you, then please tell us why you specifically want to trigger the modifier separately.

1 Like

No. It's just the process of using the "carousel" of active apps with CMD-Tab (on the Mac which equals alt-tab on Windows) in order to select one - NOT a specific one each and every time...don't you know what I'm referring to ?

See the video link in brackets....:
(HiDrive)

AAAHHHHHH!!! I get it!!! You want the app switcher to remain visible between presses of Tab!!!!

Of course!!!

This wasn't clear to me until this very moment! :man_facepalming:t2:

I don't think this is what you were initially asking for in your first question. But the answer to replicate this in Keyboard Maestro has already been given:

That will keep the carousel visible and click through three apps. Without the "hold" Action at the start, nothing would happen.

One thing that might help you come to terms with the way Keyboard Maestro works is that each Action completes what it does before the Macro moves on to the next Action. They don't overlap. That is why it is necessary to keep ⌘ being held down in the three Actions that follow the initial "hold" of ⌘.

I'm afraid I've already given the best solution I can think of in THIS POST. I'll post it here again, tweaked to do exactly what I'm 74% sure you want:

X- Keys - Hold Alt.kmmacros (23 KB)

Macro screenshot

X- Keys - Press Tab.kmmacros (20 KB)

Macro screenshot

All you have to do is replace the Stream Deck triggers with your X-Keys ones.
Again, the drawback is that, because it uses AppleScript, you have to wait about 0.5sec before pressing the second key. This is the best I can do, I'm afraid.

1 Like

The following is an answer after completely misunderstanding the question, left for posterity to show what an idiot I can be! Sorry for wasting your time...

@uliauer -- The following works for me:

Movie of it in action at http://www2.gurdon.cam.ac.uk/~nigel/Alt-Tab_Macro.mov -- forgive it looking rather shonky, not easy to do on a remote machine over a VPN and "rural" broadband!

That's with Parallels Desktop v15, Windows 10, and "Send macOS system shortcuts..." set to "Never", as previously discussed. I put the pauses in more to show what's going on, but it might be that they are important. Perhaps try with those in, then steadily reduce the times until something breaks...

Of course, none of the above means it will definitely work for you -- different Parallels version, beta Windows OS, etc, etc. But it shows it can be done, and if it's not working for you it isn't because of a basic deficiency in KM.

He doesn't want to automate multiple presses. He wants to hold Alt so that the Application Switcher (or whatever Windows calls it) appears onscreen. He then wants to press Tab manually to switch through the carousel. This whole time, Alt needs to be pressed down to keep the Application Switcher active. That's the key part of what we were all missing.

I do wonder whether there might be a way to re-map these keys inside Windows or Parallels though. I vaguely remember VMWare could do it... maybe...

Gaah! I'm still on our previous conversation!

OK -- so the Windows "window switcher" doesn't appear when you press Alt, it appears when you press Alt-Tab and remains while you hold down Alt. Same behaviour as Mac's Cmd-Tab in other words (hey, they "borrowed" so much from us, we deserve this one :wink: ).

So my new thought is:
A macro triggered by hardware key 1 that

  • does press-and-hold on the Option key
  • sets aVariable to true
  • repeats while aVariable is true, type Alt-Tab then pause 0.5 seconds

and a macro triggered by hardware key 2 that exits macro 1.

So instead of repeatedly hitting a key to get the window you want, you let the windows cycle then hit the key to stop on the window you want. @uliauer -- would that kind of workflow work for you?

@Nige_S, Ummm... you mean like this? :joy::joy::joy:

@uliauer, have you seen these articles about remapping keys in Parallels? May or may not provide a nicer solution that doesn't involve AppleScript and its inherent (relative) sluggishness.

Ummm... I guess so! TBH, I didn't even know you could set a key-down and a key-up trigger for the same macro to turn it into a "while key is pressed" one. Definitely one to file away for later.

Now all I need is an "insert :man_facepalming: after every stupid post" macro. Should be pretty easy -- something like "If posted by Nige_S, insert..." would be good enough, going by tonight's showing...

1 Like

Don't feel too bad mate. I was going :banana::banana::banana: trying to figure out what @uliauer was after. He hasn't yet confirmed that we're there, but I've already opened the :champagne: in preemptive celebration. Let's hope that moment of headscratching is behind us!

YEAH !!! CONFIRMATION !!! YOU GOT IT !!!! :rofl: :rofl: :rofl:....maybe ?

I think (or better I thought) I've described it already like that but just in order to bring all of your creative ideas on spot again: I really want to use the app-selection with CMD-TAB on the Mac or the equivalent in Windows with alt-Tab just as I use it using a normal keyboard - just with two keys of my USB XKeys keypad instead of the "original" keyboard keys.

No programmed timings or anything else.

No tricks. No magic. No fairy dust.

Just the same dumb action "forwarded" from my USB device keys.


Unfortunately this is exactly what is NOT working either...I've tried that after Peter's explanations that a modifiier being held down stops and later resumes that once another key being pressed - I still don't understand at all what sense this could make - except for Peter's super-special application of a scrolling image... :wink:

So guys - thanks anyway for your time and efforts so far !!! Really appreciate that ! I'll check out noisneil's Links - hopefully that helps...!

BTW:

Yes. I've tried that already during solving other problems on my old machine but as long as it doesn't even work in Mac OS with CMD-TAB it's not an issue now. I personally don't think that this is the problem right now. And hence my intention to go one step back to find a solution on the Mac first in order to narrow it down - once that works and I then have problems transferring it to Parallels I'll adress that !

Good?

Apparently you can get quite granular with Parallels remapping, so I'm sure there must be a solution. You can't be the first person to have needed this. However, here's one more avenue you could investigate...

I was going to suggest using Karabiner Elements to remap your keys but then I realised that, although you would want pressing ⌘ to simulate ⌥ for the application switcher, you'd mostly want it to simulate ^ elsewhere in Windows. So...

How about installing AutoHotey on your windows VM and remapping your keys through that? I briefly looked into it and it looks like it might be possible. The best thing is, the software is free, so you might as well give it a try if remapping via Parallels doesn't get you there.

https://www.autohotkey.com/boards/viewtopic.php?t=34739

Hey noisneil,
I think you're on the wrong path again - I don't want to simulate ⌥ while pressing ⌘ at all....I want to simply press and hold ⌥ just like normal use only remotely controlled by the external key hardware.

Maybe AHK could do it. But then I'd need to wrap my brain around another software on top of KM, which I need to use on the native Mac anyway, and which may cause another avalanche of problems - aside from questionable XKeys-device support....

As I said already - I'd like to get this thing to work on the Mac with CMD-TAB first. If that works I'll go the next step

I still worry that the removal of kexts means you can't do exactly as you used to do. We aren't sending "hardware events" any more (like our keyboard still does and ControllerMate et al used to do), and "software events" that might work directly on the Mac OS (like @noisneil 's "System Events" trick) may not "carry over" across multiple events when being interpreted by Parallels then forwarded to the VM.

Unfortunately I'm not near my Parallels machine to try (sending an "Option" keypress to a KM action is really difficult over a remote desktop connection!). @ulilauer, could you try and see if you can activate the Windows "sticky switcher" from KM using a "Ctrl-Alt-Tab" keystroke? You'd then be able to cycle through by sending simple arrow key keystrokes, no persistent modifier key required. If it works, that might get you towards something useful...

1 Like

Did you try this? It does what you want to do, but with a slight caveat related to timing.

I think we've pretty much covered every permutation of how you could go about that. If none of these work for you, you might have to settle for using ⌘Tab.

From my brief research this morning, it looks like there isn't much to it. Given the amount of time spent on this thread, I'd say it might warrant five minutes of your time to investigate, if other methods are insufficient.

This seems like it could be fruitful.

Hadn't considered this and don't have Parallels to test.

Hey noisneil,
aside from all the various suggestions....may I ask you again for trying out with two keys of your StreamDeck whether you can get what I want to accomplish (I think YOU know what I mean now, don't you? ;-).
If you find a way creating a macro for CMD-TABing through apps using two buttons on SD this could be the solution - and a quick relief for everybody in this threat ! ;o)