MarkJerde / Logitech-G13-Profiles

My Logitech G13 Profiles
4 stars 0 forks source link

Trying to find the equivalent of holding down LSHIFT #2

Open fitur opened 2 years ago

fitur commented 2 years ago

Hi, Thanks for a great alternative. I've missed using my G13. I'm trying to bind a G-key to emulate holding down the LSHIFT button. For instance, if I I press and hold down G12 which should emulate pressing and holding LSHIFT and then press G14 which is bound to the keystroke 2, I should get the equivalent of pressing LSHIFT and 2. How do I accomplish this in XML?

MarkJerde commented 2 years ago

Hi @fitur, Do you have a mappings file you are already working with which has these macros and mappings and they aren't working, or are you wondering how to create the xml file?

fitur commented 2 years ago

I haven’t used the G13 in years and I assume that I’ve removed all profiles. Can I create a profile on a PC with the OEM-software installed and use the exported profile with Extra Keys on my Mac?

MarkJerde commented 2 years ago

Yeah. Extra Keys can load Logitech’s profiles from both Mac and Windows (aside from the path to the exe needing to be changed to a path to an app). Logitech used the same key names and everything between Mac and Windows, so the naming is all kind of Windows-centric.

fitur commented 2 years ago

I created a profile and exported it in Windows 10 and made sure I used the same function in my Mac G13 XML but it seems as I can’t make the G13 press and hold a G-key while pressing another G-key in Extra Keys. Previously with the OEM software, one of my G-keys emulated LSHIFT, which I could press and hold while pressing other G-keys which emulated 1,2,3,etc individually, to emulate shift+1, etc. I can’t get it to work unfortunately.

MarkJerde commented 2 years ago

Thanks for letting me know, and for identifying how it worked with Logitech’s software. I’ll experiment with the keystroke synthesizer and see if I can get that working.

fitur commented 2 years ago

Hey @MarkJerde, I've messed around with creating a multikey macro instead of just a LSHIFT keystroke and tried pressing the equivalent G-key followed by pressing "a", "b", "c" or any other regular MacBook key, but it doesn't capitalize the keypress. Any idea what I'm doing wrong?

`

  </macro>`
benbeetle commented 2 years ago

@fitur I am having the same exact problem! Works correctly on Windows but not matter what I try, I can't get shift to "stay down" and type the capital version of the letter.

@MarkJerde any ideas?

I'd pay if you can get this working! :-D

benbeetle commented 2 years ago

I could also provide screen recordings, logs, etc - anything to help - you name it!

MarkJerde commented 2 years ago

Hi @fitur and @benbeetle, Thanks for your questions. I dug into the macOS keyboard synthesis API a little bit and it really isn't friendly to held keys. But I found a bit of a different approach that actually worked. So you aren't doing anything wrong that it isn't working right now. It'll take a bit of thought for me to decide how this different (far less straightforward) approach fits into Extra Keys and get an update out. It's never good to promise ship dates, but I think you have an important use case here so I hope I can get a release out that supports this by the end of July. Sorry for the wait, and thanks for bringing this use case to my attention.

benbeetle commented 2 years ago

@MarkJerde No prob! I am a developer - never developed anything for Mac, by please do let me know if I can do anything to help! Be it dev, troubleshooting, researching, trial and error... point me in the right direction and I may be able to help :-) Having this feature would make the g13 perfect for my use on Mac.

fitur commented 2 years ago

Thank you @MarkJerde. Have a great summer!

jarodwilson commented 1 year ago

I've got the same issue of wanting to press a modifier key on one key and then a second key while the modifier is held, but the problems I'm seeing go a bit deeper: key repeats simply never work, even for things like holding a key mapped to up arrow. I've tried playing with rapidRelease setting to no avail, it seems the key is always released, which makes using it for navigation (both in files and in games) kind of ... not so useful.

jarodwilson commented 1 year ago

Oh. I take it back. If I map up/down/left/right as a keystroke macro instead of a multikey macro, they work as expected in specifically targeted apps, so I'm all set there, and just looking for the ability to have modifiers mapped and held while I press another key on the g13 (same as the OP, I think).

jarodwilson commented 1 year ago

Aaaand now I have modifiers almost working, with something like this in the config xml:

<macro name="Shift" hidden="false" guid="{C6F8D067-C94B-4CA3-99A8-BE2C7F499FE2}" color="4278246655">
  <keystroke xmlns="http://www.logitech.com/Cassandra/2010.1/Macros/Keystroke">
    <key value="LSHIFT"/>
    <modifier value="LSHIFT"/>
  </keystroke>
</macro>

Except the modifier doesn't release when I release the key, it seems to stick for at least a few seconds (upwards of 10 sometimes).

I've tried having an entry w/just the modifier field and no key, but it seems to do nothing at all. Still experimenting...

jarodwilson commented 1 year ago

Erm, I think it's actually only working if I have key value LSHIFT, modifier value RSHIFT, if they're the same side shift, the key does nothing at all. Okay, I'm done for now. I think. :)

MarkJerde commented 1 year ago

Just an update on this. I just finished initial testing of macros-that-hold-modifier-keys support in Extra Keys. It seems to work well when combined with other key presses (on the regular keyboard or on the G13) and seems to work well with mouse clicks as well (though I found a few odd spots). I'll be doing a bit more testing with these features on my regular daily machine to be sure they are ready to release, but hope to get an update out for you soon.

Thanks, Mark

MarkJerde commented 1 year ago

@jarodwilson That's an interesting idea to specify a shift key as a key rather than a modifier (or as both) in the macro. I'm not surprised it behaved somewhat odd, given how Apple synthesizes keystrokes, but it was a good idea to try. Hopefully it'll all be working how you need with just the modifier in the next release of Extra Keys.

MarkJerde commented 1 year ago

It took a little longer than I had hoped to get time to prioritize Extra Keys, but I'm thrilled to say that Extra Keys 1.1.2 with support for held modifier keys has been released! I hope it works wonderfully for you all. https://apps.apple.com/us/app/extra-keys/id1541973430?mt=12

Thanks for keeping the bug reports and feature requests coming. It is a joy to see Extra Keys grow to meet more people's needs. Mark

fitur commented 1 year ago

Hi @MarkJerde, Thanks for the update! I just tried it and it works as intended, although I can't figure out how to make it just into a modifier. I tried this which holds LSHIFT for 0.5 seconds: `

  </macro>`

I also tried this which doesn't seem to do anything: `

  </macro>`
MarkJerde commented 1 year ago

Hi @fitur, Try using <modifier value="LSHIFT"/> instead of <key value="LSHIFT"/>. It matters for it to be a "modifier" on the keystroke macros (but should be "key" in multikey because that what Logitech decided 🙂).

For the multikey, maybe the repeat on it is causing an interesting interaction. Without looking at the code, I would guess that it holds shift, then holds it again 25 ms later (no effect) and keeps on with that until 500 ms after the first it releases shift and at the same time tries to hold it (500 being a multiple of 25 they would be very close to at the same time) and thereafter the end of each run of the macro coincides with the start of another run and each end tries to clear the hold. I intentionally didn't put any support in for counting how many times Extra Keys had been told to press and release each modifier, just for sake of simplicity. I could add it, but the number of cases where it is really essential is probably very small. If you remove the repeat parameters from the multikey macro it might work fine.

Hope this makes sense and helps get you going. Let me know if anything more is needed.

Thanks, Mark

fitur commented 1 year ago

That works great. Thank you!!!

5 nov. 2022 kl. 01:40 skrev MarkJerde @.***>:

Hi @fitur https://github.com/fitur, Try using instead of . It matters for it to be a "modifier" on the keystroke macros (but should be "key" in multikey because that what Logitech decided 🙂).

For the multikey, maybe the repeat on it is causing an interesting interaction. Without looking at the code, I would guess that it holds shift, then holds it again 25 ms later (no effect) and keeps on with that until 500 ms after the first it releases shift and at the same time tries to hold it (500 being a multiple of 25 they would be very close to at the same time) and thereafter the end of each run of the macro coincides with the start of another run and each end tries to clear the hold. I intentionally didn't put any support in for counting how many times Extra Keys had been told to press and release each modifier, just for sake of simplicity. I could add it, but the number of cases where it is really essential is probably very small. If you remove the repeat parameters from the multikey macro it might work fine.

Hope this makes sense and helps get you going. Let me know if anything more is needed.

Thanks, Mark

— Reply to this email directly, view it on GitHub https://github.com/MarkJerde/Logitech-G13-Profiles/issues/2#issuecomment-1304358885, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACO2NJWEOXCH3NONQJ7RUY3WGWUHPANCNFSM5V6BZBEA. You are receiving this because you were mentioned.