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

Please add ability to filter keys in the Key Mapping #322

Open
d0vgan opened this issue Nov 4, 2020 · 8 comments
Open

Please add ability to filter keys in the Key Mapping #322

d0vgan opened this issue Nov 4, 2020 · 8 comments

Comments

@d0vgan
Copy link

d0vgan commented Nov 4, 2020

At first, thank you for the SharpKeys !
I am using SharpKeys 3.9.2 and wondering how could it be that there is no filtering in the Key Mapping dialog?
With the list-boxes containing 200+ items it would be brilliant to be able to filter the items in these boxes by typing partial name of a desired key. I'm thinking about a "filter" edit-box right above each list-box in the Key Mappings dialog. Once anything is being typed in one of these "filter"edit-box, the corresponding list-box will immediately reflect that by keeping only those keys that contain the typed text in the names of the keys.
Note: Handling Ctrl+Backspace may require an explicit handler (method) that will delete the last word prior to the caret, because Windows' edit-box is known for inserting a stupid unreadable symbol as the result of pressing Ctrl+Backspace rather than deleting the word prior to the caret.
What do you think?

@randyrants
Copy link
Owner

Thanks for the feedback! I'll leave this open for the filter aspect, in case anyone wants to work on that. I will say that the header of each line item can act like a filter (and I think it's why things are sorted that way) but I think most people use the Type Key window when setting up keys, so I don't know how much value it will add. That said, always happy to riff on things, which is how the load/save key mappings came about.

With regards to modifiers keys, there's no way for SharpKeys to help. Please investigate Microsoft PowerToys for that. Thanks!

@d0vgan
Copy link
Author

d0vgan commented Nov 17, 2020

I've created a draft update that demonstrates the proposed filtering ability.
I'm not sure about the exact look of the modified interface (whether the filter should be at the bottom or at the top) and whether you like it or not, so I did not create a pull request for this.
Also I've modified the tab-order of the controls, so that one can jump from control to control using the Tab button. Though the very first Tab pressed (when the focus goes from the lbFrom to the edFilterFrom) creates a strange flickering or repainting effect. I don't know what is the cause of this flickering/repainting. Maybe you do?
Dialog_KeyItem.zip

@randyrants
Copy link
Owner

I'll take a look if I have time over the coming holiday break but there's no way in hell I'm ever going to merge a file that has "M$" as a reference to Microsoft in the comments. Ever.

@d0vgan
Copy link
Author

d0vgan commented Nov 23, 2020

The comment with "M$" relates to the behavior that is (for unknown reason) preserved since Windows 9x (!) and irritates me very much. The following table illustrates it:

Keys pressed   | Reaction                | Comment
---------------|-------------------------|-------------
Delete         | Delete next symbol      | OK
Ctrl+Delete    | Delete next word        | OK, logical
BackSpace      | Delete previous symbol  | OK
Ctrl+BackSpace | Inserts '\x7F'          | WTF?

I've faced it once again just today while I was editing Debugging Command in project's properties in Visual Studio and pressed Ctrl+BackSpace to (as I had expected) delete the last word. Why I need an unreadable symbol \x7F inserted as the result of pressing Ctrl+BackSpace? What am I supposed to do with that symbol? I have no idea.
And another thing irritated me almost at the same time. I was building the project configuration Release|Win32, but for unknown reason the project properties windows was open for Debug|Win32 configuration. I have no idea why the project properties window does not follow the active configuration, but this behavior is preserved since Visual Studio 2013, I believe.
Because of that and some other things I may not call myself a Microsoft fan.

@WebMechanic
Copy link

Hi, I second that request.
It's a very useful feature also available in VSCode, CudaText or IntelliJ apps from JetBrains and likely any other decent IDE.

They allow to filter for a specific keystroke to learn what command it (might) execute, where you just press the keys and the keymap lists the command[s] -- or not = keystrokes are free to assign to a command/action.

If the displayed list of key mappings is essentially strings, filtering shouldn't be that complicated, given what the app is doing in the backend :)

thanks for this great tool!

@YellowAfterlife
Copy link

Hah, I didn't notice that there's an existing PR and made another implementation in an afternoon
image
I think this is good to have in general

@d0vgan
Copy link
Author

d0vgan commented Aug 19, 2023

Hah, I didn't notice that there's an existing PR and made another implementation

As you are using the latest sources, yours is preferable, I believe.
By the way, are you handling Ctrl+Backspace in the filtering controls? A good behavior of Ctrl+Backspace is to remove the previous text rather than insert a strange unreadable symbol.

@YellowAfterlife
Copy link

Hah, I didn't notice that there's an existing PR and made another implementation

As you are using the latest sources, yours is preferable, I believe. By the way, are you handling Ctrl+Backspace in the filtering controls? A good behavior of Ctrl+Backspace is to remove the previous text rather than insert a strange unreadable symbol.

For purposes of minor contributions, I do not commonly concern myself with fixing bugs in Microsoft's implementations of system components.

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

No branches or pull requests

4 participants