Open LukasFiniarel opened 5 years ago
Any updates on this? I have the similar issue when trying to trigger combination or sequence ending with Shift. Example: Combination.FromString("Shift+W") works but Combination.FromString("W+Shift") does not.
I think I found the issue and this fix has solved both your problem & mine according to my testing.
113 sequence-control-control-fix
I think I found the issue and this fix has solved both your problem & mine according to my testing.
It doesn't work. Pressing any key after control fire action. Also, It doesn't work for Alt key. For example "ALt, Alt";
Hi @toelli, hi @kokabi1365,
I have added the e.KeyCode.Normalize()
fix (#113) and the following lines to the ConsoleHook Example.
var map = new Dictionary<Sequence, Action>
{
{Sequence.FromString("Control+Z,B"), () => Console.WriteLine("CTRL-Z followed by 'B'")},
{Sequence.FromString("Control+Z,Z"), () => Console.WriteLine("CTRL-Z followed by 'Z'")},
{Sequence.FromString("Control,Control"), () => Console.WriteLine("CTRL followed by CTRL")},
{Sequence.FromString("Shift,W"), () => Console.WriteLine("Shift followed by 'W'")},
{Sequence.FromString("W,Shift"), () => Console.WriteLine("'W' followed by Shift")},
{Sequence.FromString("Alt,Alt"), () => Console.WriteLine("Alt followed by Alt")},
{Sequence.FromString("Escape,Escape,Escape"), quit}
};
So I was able to test some sequences:
Control
, Control
-> result: "CTRL followed by CTRL" - 🆗 Control
, Control
, Control
-> result: "CTRL followed by CTRL", "CTRL followed by CTRL" - is this correct ❓ Shift
, W
-> result: "Shift followed by 'W'" - 🆗 W
, Shift
-> result: "'W' followed by Shift" - 🆗 Shift
, W
, Shift
-> result: "Shift followed by 'W'", "'W' followed by Shift" - is this correct ❓ Alt
, Alt
-> result: "" - ❌ Alt
, W
-> result: "Shift followed by 'W'" - ❌ Any comments?
"Control, Control" doesn't work yet.
I want to open a WPF Window if a user presses the (left) Control button two times. This is my Code:
The Application starts correctly but the sequenze doesn't trigger my action. If I change the sequenze to "A,B", it runs perfectly.