BenziAhamed / Menu-Bar-Search

Quickly search through menu options of the front-most application - Alfred Workflow
550 stars 29 forks source link

add ability to search shortcuts #22

Closed FischLu closed 1 year ago

FischLu commented 1 year ago

To be able to search shortcuts is important for me in case I need to assign some global shortcut to my Alfred workflow, I have to check whether the shortcut is used by my most commonly used apps.

The short cut searching starts from the symbol #, 4 mac modifier keys cmd, shift, alt, ctrl can appear at any order and separated by space, the single key must be at the last position (o for example in the image)

image

Also, it is possible to search shortcuts with only modifier keys

image
BenziAhamed commented 1 year ago

I like this idea. Some general thoughts:

FischLu commented 1 year ago

I have moved the parser to RuntimeArgs and add support to all virtual keys, the key code from the AX.swift file, however I think the key name from the comment in the file is too long to type, so I have asked ChatGPT to generate a short version (lazy).... And now all of the shortcut keys can appear at any order during query. Xnip2023-02-08_18-12-32 Xnip2023-02-08_18-11-02

BTW, I removed lowercased() from let term = args.query.lowercased(), the args.query is already process by .caseInsensitive

I think you have to add this keycode list to readme

"ctrl", "⌃"
"alt", "⌥"
"shift", "⇧"
"cmd", "⌘"
"ret", "↩"
"kp_ent", "⌤"
"kp_clr", "⌧"
"tab", "⇥"
"space", "␣"
"del", "⌫"
"esc", "⎋"
"caps", "⇪"
"fn", "fn"
"f1", "F1"
"f2", "F2"
"f3", "F3"
"f4", "F4"
"f5", "F5"
"f6", "F6"
"f7", "F7"
"f8", "F8"
"f9", "F9"
"f10", "F10"
"f11", "F11"
"f12", "F12"
"f13", "F13"
"f14", "F14"
"f15", "F15"
"f16", "F16"
"f17", "F17"
"f18", "F18"
"f19", "F19"
"f20", "F20"
"home", "↖"
"pgup", "⇞"
"fwd_del", "⌦"
"end", "↘"
"pgdn", "⇟"
"left", "◀︎"
"right", "▶︎"
"down", "▼"
"up", "▲"