wpf - Difference between KeyEventArgs.systemKey and KeyEventArgs.Key -


whats difference between keyeventargs.systemkey , keyeventargs.key? fine trap key press event in wpf usercontrol class shown below.

    protected override void onkeydown(keyeventargs e)     {         base.onkeydown(e);          if(e.systemkey == key.leftalt || e.systemkey == key.leftctrl || e.systemkey == key.rightalt)         {             this.focus();             closeanyopenpopups();         }     } 

thanks

because alt key handled system using e.systemkey possibility find out if alt pressed. property key return key.system.

to make sure right key use expression:

key key = (e.key == key.system ? e.systemkey : e.key); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -