c# - Visual Studio Extension KeyProcessor Alt Key -
cant event on alt+key. example alt+e. event firing e , alt, no alt+e mb problem in ikeyprocessorprovider
? have usercontrol, , want used inner control buttonkeyproc.keydownevent+=
.
[export(typeof(ikeyprocessorprovider))] [textviewrole(predefinedtextviewroles.document)] [contenttype("any")] [name("buttonprovider")] [order(before = "default")] internal class buttonprovider : ikeyprocessorprovider { [importingconstructor] public buttonprovider() { } public keyprocessor getassociatedprocessor(iwpftextview wpftextview) { return new buttonkeyproc(wpftextview); } } internal class buttonkeyproc : keyprocessor { internal static event keyeventhandler keydownevent; public buttonkeyproc(itextview textview) { } public override void keydown(keyeventargs args) { if (args.key == key.e && isalt) { if (keydownevent != null) { keydownevent(this, args); } } } public bool isalt { { return keyboard.iskeydown(key.leftalt) || keyboard.iskeydown(key.rightalt); } }
the correct code. need used args.systemkey , keyboard.modifiers.
public override void keydown(keyeventargs args) { if (args.systemkey == key.e && (keyboard.modifiers & modifierkeys.alt) != 0) { } }
Comments
Post a Comment