Page 1 of 1

Keyboard shortcut - Ctrl+Alt+Fn+B and then down and then Enter

Posted: 27 Jan 2022, 02:09
by jeremymbwilson
Sorry if this is obvious, but I've searched these forums and also the Autohotkey documentation and can't see a way to do this.

I have a Logitech MX Keys keyboard that does not have a Pause/Break key that most keyboards do. I also (like a lot of people) am working from home a lot and connect to my work through Citrix. When I am in a Citrix session, and I want to switch into my "home" environment, I would go to the "Desktop Viewer Bar" (essentially a set of shortcuts) and choose "Home" which gets me back into my "Home" environment. I would like to map that function to one of my keys on my MX Keys keyboard, if possible.

The keyboard shortcut to bring up the "Desktop Viewer Bar" is Ctrl+Alt+Fn+B, but then I need to press down and then hit Enter.

Is there a simple script that I could use to perform this sequence of events ? I could then assign that to e.g. Ctrl+F8 and then assign Ctrl+F8 to a key on my keyboard.

Sorry - this all sounds a bit ridiculous, but would be grateful if anyone can help this dummy achieve this !

Many thanks in advance.

Re: Keyboard shortcut - Ctrl+Alt+Fn+B and then down and then Enter

Posted: 27 Jan 2022, 04:21
by boiler
The Fn key is typically something that is handled at the keyboard hardware level and not seen by the OS and AHK, so it can’t be used as a hotkey nor sent as a virtual key press. This is true of Logitech keyboards in my experience. You can check the key history after pressing it while running a script to confirm that.

Re: Keyboard shortcut - Ctrl+Alt+Fn+B and then down and then Enter

Posted: 27 Jan 2022, 05:28
by jeremymbwilson
Thanks @boiler

I have found that to bring down the menu for Citrix I can use Ctrl+Alt+Pause/Break, but the MX Keys keyboard does not have a Pause/Break button. Would there be a way for AHK to have a simple script for Ctrl+Alt+Pause/Break followed by Down arrow followed by Enter ?

Re: Keyboard shortcut - Ctrl+Alt+Fn+B and then down and then Enter

Posted: 27 Jan 2022, 07:40
by boiler
Yes, try this to have that be sent when you press Ctrl+F8:

Code: Select all

^F8::Send, ^!{Pause}{Down}{Enter}

In case there needs to be a bit of a delay before the Down and Enter, you could try this:

Code: Select all

^F8::
	Send, ^!{Pause}
	Sleep, 50
	Send, {Down}
	Sleep, 50
	Send, {Enter}
return

Re: Keyboard shortcut - Ctrl+Alt+Fn+B and then down and then Enter

Posted: 28 Jan 2022, 03:47
by jeremymbwilson
Thanks so much @boiler.

For some reason, I couldn't get it to work with Ctrl+F8 (presumably an existing keyboard mapping). Was scratching my head and tried Ctrl+F9 and it works perfectly.

Thanks, again, for your help - much appreciated !