Skip to content
Discussion options

You must be logged in to vote

Sorry for the very late answer. Right now combinations only listen and cant block keys. But you can get the same result with Prevent and a condition, and run your action in KeyPrevented. Something like this

var listener = new KeyboardListener();
var keyboard = new KeyboardManipulator();

keyboard.Prevent(Key.OemMinus, () => listener.IsCtrlPressed && listener.IsShiftPressed);

keyboard.KeyPrevented += args =>
{
    if (args.KeyPressed == Key.OemMinus && args.Event == KeyboardInputEvent.KeyDown)
        SkipTask();
};

The minus key is blocked only while Ctrl and Shift are held, so nothing gets typed. A built in option to block keys for a combination would be nice too, I'll think about it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AlexanderBlackman
Comment options

Answer selected by AlexanderBlackman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants