Logitech Keys-to-go for IPad on Windows

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 21 Dec 2022, 05:48

Hi,

I have a Logitech Keys-to-go keyboard for iPad with Italian layout (Logitech Keys-to-go keyboard) which I'm trying to use and adapt for Windows. In the attached picture I've labelled each key with a number for convenience. Below I paste my script, which I also attach as a file.

I'd like some help in remapping
  • the Globe/net button (labelled 069 in my picture)
  • first 4 keys of first row (labelled 001-004)
  • last 3 keys of first row (labelled 012-014)
Globe/net button (labelled 069 in my picture)

I'd like it to act in any circumstance as a Ctrl (or LCtrl, that is as key 070 as per my labelling). Below the snippet of the script in which I set the hotkey and what I read from from 'Key history and script info' when pressing that key. It's like it is sending the codes of 2 keys (LControl and Space). In the script there are other attempts (using #HotIf GetKeyState()).

Code: Select all

; VK SC Type Up/Dn Elapsed Key
; A2 01D d 20.89 LControl
; 20 039 d 0.00 Space
; 20 039 u 0.03 Space
; A2 01D u 0.98 LControl

; A2 01D d 33.03 LControl
; 20 039 h d 0.00 Space
; A2 01D i d 0.00 LControl
; 20 039 h u 0.03 Space
; A2 01D i u 0.00 LControl
; A2 01D   u 0.98 LControl 
<^Space::LCtrl
The hotkey seems to work alone. In fact if I do

Code: Select all

<^Space::
{
  Send "{Control down}c{Control up}"
}
the Globe key (069) copies the selected text. However it doesn't act as Ctrl when used for copy (Ctrl+c), cut (Ctrl+x), paste (Ctrl+v) or closing tabs (Ctrl+w) or switching between Desktops (Ctrl+Win+RArrow or Ctrl+Win+LArrow). In short it does not work together w/ any other key).

First row (labelled 001-004 and 012-014)

In 'Key history and script info' I cannot see anything when pressing the first 4 keys and the last 3 keys of the first row. Can someone help me in detecting those keys if possible?

The whole script

Code: Select all

#Requires AutoHotkey v2.0-beta

; ----------------------------------
; NOTES
; ----------------------------------
; + = SHIFT
; ^ = CTRL
; # = WIN
; ! = ALT
; <^>! = ALTGR
; ----------------------------------

InstallKeybdHook

; Wrongly mapped characters
<::\
>::|
\::<
|::>

; Additional characters
<^>!ì::~
<^>!'::`

; Globe key (bottom-leftmost key)
; sends these codes (copied from
; 'Key history and script info')
; VK SC Type Up/Dn Elapsed Key
; A2 01D d 20.89 LControl
; 20 039 d 0.00 Space
; 20 039 u 0.03 Space
; A2 01D u 0.98 LControl

; A2 01D d 33.03 LControl
; 20 039 h d 0.00 Space
; A2 01D i d 0.00 LControl
; 20 039 h u 0.03 Space
; A2 01D i u 0.00 LControl
; A2 01D   u 0.98 LControl 
<^Space::LCtrl

; Not working
; #HotIf GetKeyState("Space", "P")
; ^c::Send "Hotkey activated."

; Not working
; #HotIf GetKeyState("LControl", "P")
; Space & c::Send "Hotkey activated."

; Left Alt and Cmd key switched
; (Cmd key is Win key on Windows)
LAlt::LWin
LWin::LAlt

RWin::RAlt

; First row of Apple iOS shortcuts
; (14 keys)
; mapped to Ctrl + Esc F1-F12 Del
; ^::Esc
; ^::F1
; ^::F2
; ^::F3
^Browser_Search::F4
^Media_Prev::F5
^Media_Play_Pause::F6
^Media_Next::F7
^Volume_Mute::F8
^Volume_Down::F9
^Volume_Up::F10
; ^::F11
; ^::F12
; ^::Del
Thanks
Attachments
keysToGoWindows.ahk
(1.4 KiB) Downloaded 28 times
logtchKeysToGoLabls-12a92.png
Logitech Keys-to-go labelled
logtchKeysToGoLabls-12a92.png (550.43 KiB) Viewed 1183 times

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Logitech Keys-to-go for IPad on Windows

Post by mikeyww » 21 Dec 2022, 06:26

Hi,

Just a few thoughts, perhaps not an answer.

1. Your attached script has commented the line that it seems you are trying to test.

2. This is the v1 forum. The v2 forum is viewforum.php?f=82.

3. I would follow all of the specific instructions at https://www.autohotkey.com/docs/v1/KeyList.htm#SpecialKeys.

4. The one-line remap did work here in version 1.1.36.02 when I tested it with a manual key sequence of Ctrl+Space on a US keyboard.

5. In v1, directives, such as installing the hook, start with #.

gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Logitech Keys-to-go for IPad on Windows

Post by gregster » 21 Dec 2022, 06:33

Topic moved to AHK v2 help.

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 21 Dec 2022, 11:06

Thanks you for the answer. I didn't realize this was the v1 forum. I don't see the line

Code: Select all

<^Space::LCtrl
been commented. In any case the (uncommented) line works as a hotkey alone but not if I use that key to copy, cut or paste as I explained.

I tried to read that part but I didn't have time to really dive into AHKHID.

Anyway I will follow the other forum.

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 22 Dec 2022, 05:32

mikeyww wrote:
21 Dec 2022, 06:26
1. Your attached script has commented the line that it seems you are trying to test.

4. The one-line remap did work here in version 1.1.36.02 when I tested it with a manual key sequence of Ctrl+Space on a US keyboard.
1. Oh, now I see what you mean. In the script attached as a file the line is commented and in the one I pasted in the post it's not commented.
mikeyww wrote:
21 Dec 2022, 06:26
4. The one-line remap did work here in version 1.1.36.02 when I tested it with a manual key sequence of Ctrl+Space on a US keyboard.
4. Do you mean that you manage to use, for example, Ctrl+Space+c to copy a selected text? On the logitech keys-to-go keyboard this doesn't work neither using the Globe key+c nor doing Ctrl+Space+c (but the latter works w/ another keyboard).

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 22 Dec 2022, 08:14

Hi again,

It's not entirely true that the Globe key is not working. Even without any remapping, _sometimes_ it acts as a Ctrl (e.g. in Ctrl+c or Ctrl+v). It may be a matter of perfect timing in me pressing Ctrl and c at exact same time and holding them down for exactly the right amount.

Probably it something connected to the fact that the Globe key alone sends very rapidly a sequence of LControl, Space down and Space up

How can this timing problem be solved?

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 22 Dec 2022, 09:58

I noticed that, no matter for how long I hold down the Globe key, in 'Key history and script info' I see a single press and release of the LControl and Space sequence. Any other key that I press and hold down appears with a long sequence of entries.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Logitech Keys-to-go for IPad on Windows

Post by swagfag » 28 Dec 2022, 09:26

if the globe key is hardwired to send LCtrl DownSpace DownSpace UpLCtrl Up once upon downpress and u cant change this remapping to some other normal hotkey via some Logitech software/driver (assuming its using any), and if u want the key to support a "holding" behavior, then u must implement a RAWINPUT solution. in the data packets, its probably going to say if the key is physically down or up, then u can first suppress the initial burst of LCtrl DownSpace DownSpace UpLCtrl Up and then initiate whichever action u need to, eg Send {Blind}{Ctrl DownR} and suchlike

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 03 Feb 2023, 10:30

@swagfag Thanks.

No, I can't change the remapping through some Logitech software/driver. There is Logitech Options/Options+ but it does not detect the keyboard.

I tried to search in the documentation and a little in the forum, but I do not understand what it does mean to implement a RAWINPUT solution in practice. Can you please point me somewhere where to document myself or give me some hints?

Thanks,
Luca

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 04 Feb 2023, 14:33

swagfag wrote:
28 Dec 2022, 09:26
if the globe key is hardwired to send LCtrl DownSpace DownSpace UpLCtrl Up once upon downpress
Yes it is hardwired once upon downpress.

Is there any workaround possible like simulating an holding behaviour for a fixed amount of time like in the following code, so to have time to press C in order to simulate LCtrl+C for example?

Code: Select all

<^Space::
{
  Send "{LCtrl down}"
  Sleep 1000 ; Keep it down for one second.
  Send "{LCtrl up}"
}

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 12 Apr 2023, 06:57

I'm trying to bypass the problems of hardwired Globe button in the following way. I'm intercepting all the keys in 0.4 seconds and releasing them between LCtrl down and LCtrl up.

This works decently for like "Ctrl+C" or "Ctrl+V", but I cannot intercept arrows keys or other modifiers to do things like "Ctrl+Win+Left Arrow". Can someone help?

Code: Select all

<^Space::
{
  ih := InputHook()
  ih.Start()
  KeyWait "Space" ; waits release of
    ; space
  KeyWait "LCtrl" ; waits release of
    ; LCtrl
  ih.Wait(0.4)
  ih.Stop()
  SendInput "{LCtrl down}"
  Send ih.Input
  SendInput "{LCtrl up}"
}

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Logitech Keys-to-go for IPad on Windows

Post by mikeyww » 12 Apr 2023, 07:28

The documentation shows an example of how to wait for any key.

the_eraser
Posts: 11
Joined: 19 Jan 2018, 12:57

Re: Logitech Keys-to-go for IPad on Windows

Post by the_eraser » 12 Apr 2023, 09:33

Thanks for replying.

I read that and tried it but I don't understand how to use it to solve my problem.

I'd like `Send ih.Input` to send all the keys pressed between `ih.Start` and `ih.Stop` (including modifiers and arrow keys), but apparently that's not the intended use.

I do not understand how end keys may help.

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Logitech Keys-to-go for IPad on Windows

Post by mikeyww » 12 Apr 2023, 09:39

Example #1 on that page shows you how to use ih.EndKey. I would recommend running that script so that you can see how it works for any key.

It is not a key logger for all combinations of modifier keys. You would probably need to add some special techniques that check key states for all of the modifiers, whenever a key is pressed. You could also try the "M" option, though I don't think it will capture all of the possibilities. I guess you could search the forum for "How do I make a key logger?", but I believe that this functionality is not actually supported by the forum.

Post Reply

Return to “Ask for Help (v2)”