-
Notifications
You must be signed in to change notification settings - Fork 695
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
Simplify Key
- BackTab
and upper-case alphas
#2978
Comments
@BDisp, going back to the early versions of gui.cs I actually think the right thing to do is to do that. For Terminal.Gui to fully support internationalization the internal definitions should not be so tied to the English language/keyboard. It's nice to be able to do this:
instead of this:
But, there is so much complexity in all the drivers and tests around dealing with this it doesn't seem worth it. What do you tihnk? |
@BDisp, do you remember what this special case for You introduced this in:
|
I would not be a fan of this, having to cast a I agree that
From second row onwards should all be the same. Maybe the solution would be to seperate completely the modifier keys from the AddKeyBinding ('a',Key.CtrlMask, Command.SelectAll); To go further we could change Key from an enum to a class with modifiers? new Key('a', Modifier.Shift); |
Some Linux shortcuts are tied to lower case and for that cases is needed the
Remove all the lower cases it worth.
For the lower case shortcuts that Linux/mac users are used we must maintain them, I think. And I'm a Windows user :-) |
|
That a possibility. For example the |
We want to make life as simple as possible for end user of API. I would say that we should standardize input at the point of the driver (i.e. as early as possible). This means no views ever need to worry about platform or ShortcutHelper etc. If possible there should be a uniform cannonical class which clearly shows what keys were struck and the modifiers held at that time. It should be immutable and work the same on all OS. If a modifier key or combination is known to not work on a given OS the xml class docs should indicate that. |
@tznind when you get a chance, I'd like you to opine on how #2927 looks to you in this regard. E.g. this is now typical: AddKeyBinding ((Key)' ', Command.ToggleChecked);
AddKeyBinding (Key.Space, Command.ToggleChecked);
I'd like to propose an API on |
AddKeyBinding ((Key)' ', Command.ToggleChecked);
AddKeyBinding (Key.Space, Command.ToggleChecked); I am confused. This looks like the same thing twice. Are you sure this is needed? The following test passes so the above code is literally just doing the same thing twice. [Fact]
public void EqualRight()
{
Assert.Equal ((Key)' ', Key.Space);
} |
I think this is a great idea. Some low level logs of events in general would be really nice. Especially when debugging user issues. Starting with the most unpredictable areas of the codebase makes sense (i.e. curses driver ;) ). |
I love your work on this PR. It is pretty epic! (+/- 24,000) and definetly a big improvement and standardization. I am still uneasy with the way we have an Enum for which not all values are defined and which seems to be inconsistent. To illustrate (see below). But I want to be practical about it. I think we should merge the key binding changes and worry about this later and/or investigate it seperately on its own. [Fact]
public void TestIfEqual()
{
// Test fails
Assert.Equal ((Key)'a' | Key.ShiftMask, Key.A);
} |
I think that's only need one of them (Key.Space) because the are the same. |
@tznind even the |
Specially on Linux the
BackTab
is specific. Test on both Windows and Linux, before.Yes, I really regret implementing it. You can remove them without any problems.
For me, go for it. Thanks.
Originally posted by @BDisp in #2972 (comment)
The text was updated successfully, but these errors were encountered: