mydockfinder / mydockfinder-for-Win10-Win11

1.09k stars 273 forks source link

Improve Application menu detection w/ fallback options #257

Open rbreaves opened 2 years ago

rbreaves commented 2 years ago

I am very impressed with what I have seen, but can we also add in the ability to override or create fallback menus per application?

Suggestion or example would be a yaml formatted file, which can define application menus for as many applications as you want as long as the options have an associated hotkey or Alt key combo path to reach that option.

Applications:
  notepad.exe:
    File:
      - New [Ctrl+N]
      - New Window [Ctrl+Shift+N]
      ...
     Edit:
       - Undo [Ctrl+Z]
       ...
  code.exe:
      File:
        - New [Ctrl+N]
        - New Window [Ctrl+Shift+N]
        ...

Additionally if we could swap out references to Ctrl, Alt or Shift with symbols such as ⌘, ⌥, ^, or ⇧, then that would be wonderful too.

mydockfinder commented 2 years ago

这是一个不错的想法,我以后想想怎么融合进去

------------------ 原始邮件 ------------------ 发件人: "mydockfinder/mydockfinder-for-Win10-Win11" @.>; 发送时间: 2021年11月5日(星期五) 上午8:58 @.>; @.***>; 主题: [mydockfinder/mydockfinder-for-Win10-Win11] Improve Application menu detection w/ fallback options (Issue #257)

I am very impressed with what I have seen, but can we also add in the ability to override or create fallback menus per application?

Suggestion or example would be a yaml formatted file, which can define application menus for as many applications as you want as long as the options have an associated hotkey or Alt key combo path to reach that option. Applications: notepad.exe: File: - New [Ctrl+N] - New Window [Ctrl+Shift+N] ... Edit: - Undo [Ctrl+Z] ... code.exe: File: - New [Ctrl+N] - New Window [Ctrl+Shift+N] ...
Additionally if we could swap out references to Ctrl, Alt or Shift with symbols such as ⌘, ⌥, ^, or ⇧, then that would be wonderful too.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

rbreaves commented 2 years ago

Also depending on how an app is built their exe name may not be helpful, UWP apps I believe. So make sure you can match against either the exe name or the class name of a running process that has focus. An example from an Autohotkey script of mine grouping terminal application names together - the last 2 by their class name instead of exe process, because the exe process was not a unique name.

GroupAdd, terminals, ahk_exe ubuntu.exe
GroupAdd, terminals, ahk_exe ubuntu2004.exe
GroupAdd, terminals, ahk_exe ConEmu.exe
GroupAdd, terminals, ahk_exe ConEmu64.exe
GroupAdd, terminals, ahk_exe powershell.exe
GroupAdd, terminals, ahk_exe WindowsTerminal.exe
GroupAdd, terminals, ahk_exe Hyper.exe
GroupAdd, terminals, ahk_exe mintty.exe
GroupAdd, terminals, ahk_exe Cmd.exe
GroupAdd, terminals, ahk_exe box.exe
GroupAdd, terminals, ahk_exe Terminus.exe
GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, terminals, ahk_class Console_2_Main
mydockfinder commented 2 years ago

image UWP程序按程序的唯一ID区分就可以了,不过UWP程序基本上没有什么可以控制的功能

rbreaves commented 2 years ago

Even if that ID is unique it’s pretty cryptic to use, autohotkeys “Window Spy” program can detect its more readable class names & since it’s readily understood I use it instead for those apps.

Also if you allow for replacing Ctrl, Alt, Win in the dropdown sub menus then I’d make sure to leave that adjustable to the end user.

technically it’d be Ctrl = ^ Alt = ⌥ Win = ⌘

But practically when swapped for the sake of an Apple keyboard (Sharpkeys) or with my Kinto.sh app it’d be this (I intelligently swap the hotkeys around as needed). Ctrl = ⌘ Alt = ⌥ Win = ^

https://github.com/rbreaves/kinto

mydockfinder commented 2 years ago

识别Mac键盘符号可能有点困难,因为不知道mac键盘的键代码是多少

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年11月5日(星期五) 中午11:42 收件人: @.>; 抄送: "№じ @.>; @.>; 主题: Re: [mydockfinder/mydockfinder-for-Win10-Win11] Improve Application menu detection w/ fallback options (Issue #257)

Even if that ID is unique it’s pretty cryptic to use, autohotkeys “Window Spy” program can detect its more readable class names & since it’s readily understood I use it instead for those apps.

Also if you allow for replacing Ctrl, Alt, Win in the dropdown sub menus then I’d make sure to leave that adjustable to the end user.

technically it’d be Ctrl = ^ Alt = ⌥ Win = ⌘

But practically when swapped for the sake of an Apple keyboard (Sharpkeys) or with my Kinto.sh app it’d be this (I intelligently swap the hotkeys around as needed). Ctrl = ⌘ Alt = ⌥ Win = ^

https://github.com/rbreaves/kinto

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

rbreaves commented 2 years ago

The mac keycode for cmd actually translates perfectly to the win or super key as linux users know it (Firefox keycode for Cmd is 224, Chrome is 91 - but that also translates to Win/Super and of course every OS may define it differently on the OS level. I know linux does, as does the registry in Windows). Regardless Cmd and Win/Super are technically the same while Cmd and Ctrl are functionally the same.

This is why I suggest you allow for the end users to decide if they want Ctrl to be shown as Ctrl, ^, or ⌘ - because it could vary base on whether or not they have used a program like Sharpkeys, Autohotkey or my Kinto.sh application.

This would also mean that some users may not want Win/Super to appear as ⌘, users that have remapped their keyboard already may want that to appear as ^ instead of ⌘, Win or Super. If you implement this it would be best to allow the users to decide because they may align their keys differently from how you or I would align them.

Personally when I use Windows keyboards on Windows I use Sharpkeys to apply the keyswap on Alt & Win. https://github.com/rbreaves/kinto/raw/master/windows/WinToMac_AltWin_swap.skl

Then I am able to install my Kinto.sh https://github.com/rbreaves/kinto app and specify my keyboard as an Apple keyboard (granted I could have skipped using Sharpkeys at all and define my keyboard as Windows, but by doing this I can retain the ability to remote into an Apple based computer without needing to do any swapping of keys on the destination mac because Win/Super is the Cmd key on an actual mac). My key remapper, Kinto, also knows to disable itself automatically any time I am using RDP, or any type of remote desktop or virtualization software so that confusing remaps do not occur. I only remap keys on the final destination OS in use (although Sharpkey modifier key remaps are persistent in this case).

rbreaves commented 2 years ago

Also the ahk_class was brought up because of this - the ability to pull out the actual name of the UWP app would be preferred over its cryptic & unnecessary ID. If we can retain the ability to filter/match UWP apps by their class and actual name that would be great.

The title may change slightly, but AHK is smart enough to ignore the Powershell title from the app name itself apparently.

GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow

image

mydockfinder commented 2 years ago

目前我知道的只有ID是独一无二的,名称都是根据系统语言变化的,不能统一使用

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年11月5日(星期五) 中午12:24 收件人: @.>; 抄送: "№じ @.>; @.>; 主题: Re: [mydockfinder/mydockfinder-for-Win10-Win11] Improve Application menu detection w/ fallback options (Issue #257)

Also the ahk_class was brought up because of this - the ability to pull out the actual name of the UWP would be preferred over its cryptic & unnecessary ID. If we can retain the ability to filter/match UWP apps by their class and actual name that would be great.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.