Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Current Selection Service no longer works #2646

Closed
skurfer opened this issue Feb 17, 2022 · 7 comments
Closed

Get Current Selection Service no longer works #2646

skurfer opened this issue Feb 17, 2022 · 7 comments
Milestone

Comments

@skurfer
Copy link
Member

skurfer commented Feb 17, 2022

Describe the bug

I noticed ⌘⎋ wasn’t working. I checked the Services prefs and saw “033” instead of the expected shortcut. I wiped it and attempted to set it again, but the system doesn’t allow you to use ⎋ in shortcuts. (I don’t remember if it used to.)

Screenshots

Screen Shot 2022-02-17 at 9 00 42 AM

What version of macOS?

12.2.1

What version of Quicksilver?

It’s complicated. 😂

@pjrobertson
Copy link
Member

#complicated 😆

Works fine on 10.14 for me. Appears to be a regression due to macOS 12 (potentially 11)

Screenshot 2022-02-17 at 22 18 06

@pjrobertson
Copy link
Member

At the very least, the timeout shouldn't be 10s, that's way too long in this day and age. Let's make it 3s.

Screenshot 2022-02-17 at 22 22 52

@n8henrie
Copy link
Member

n8henrie commented Feb 17, 2022

Same -- 033 and won't let me use Esc after it's cleared. 12.2.1.

Oddly it still works fine in my stable build of QS -- even with the Keyboard -> Shortcuts option unticked / disabled.

It looks like it's coming from Triggers -> Quicksilver -> Command Window with Selection, which still was showing cmdEsc.

Unfortunately after clearing it, when I try to re-insert Esc, it gives me a 5 instead. ?

EDIT:

This is me trying to re-input cmdEsc on a debug build:

Screen Shot 2022-02-17 at 08 21 40

Works fine on stable, I can re-insert cmdEsc without issue.

@pjrobertson pjrobertson added this to the 2.0.0 milestone Feb 18, 2022
@pjrobertson
Copy link
Member

This is me trying to re-input cmdEsc on a debug build:

Good catch, this is likely an ndhotkey bug. I'll look into it.

The only other change I can think of is the change in 6c5fae9 that jumbled up the plist, but the before and after look the same:

Before:
Screenshot 2022-02-18 at 08 07 30

After:
Screenshot 2022-02-18 at 08 07 55

@n8henrie
Copy link
Member

\033 is 27 in octal:

$ py '0o33'
27

27 is the MacOS keycode for escape:

$ grep -i escape /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h
  kEscapeCharCode               = 27,
  kVK_Escape                    = 0x35,

In triggers.plist, the key code for command is:

<integer>1048840</integer>

and b (which I used as an example) is: <integer>11</integer>

>>> int("b", 16)
11
>>> hex(11)
'0xb'
>>> hex(1048840)
'0x100108'

My Triggers.plist has <integer>53</integer> listed for <string>Command Window with Selection</string>

>>> hex(53)
'0x35'
$ grep '35\b' /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h
  kVK_Escape                    = 0x35,

So using Esc as an example, QS is displaying octal format (\033) and storing int format (53) in Triggers.plist; I imagine the 5 I'm seeing in my screenshot above is just a truncation of 53.

@pjrobertson
Copy link
Member

I didn't really need to do the git bisect... it just confirmed what we already knew:

64b8a916ae5b9a5d174e4ed6202c7d33111e6d41 is the first bad commit
commit 64b8a916ae5b9a5d174e4ed6202c7d33111e6d41
Author: Patrick Robertson <robertson.patrick@gmail.com>
Date:   Wed Feb 9 10:11:52 2022 +0800

    Ndhotkey fixes (#2594)
    
    * Add NDHotKeyEvent as a submodule.
    
    * Use latest NDHotKeyEvent
    Fixes #2405 Fixes #1134  - #1147 can be closed

I think the fix should be easy - just use ⌘⎋ in the plist.

@pjrobertson
Copy link
Member

Yep, just required changing the plist key code to . Spent ages debugging, even dove into Etienne's code from 8 years ago. These things always end up being so simple.

Will submit a PR

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants