The Keyboard.ppt
The Keyboard Jim Fawcett CSE778 – Advanced Windows Programmingderived from a presentation by Yi-Yang Huang Jayashree Venkatesh Ignoring the keyboard Microsoft windows and windows forms class handle many keyboard functions themselves. Ignore keystrokes in menu selection. Windows forms programs define keyboard accelerators to invoke common menu items. Dialog boxes also have a keyboard interface, but programs need not monitor the keyboard when a dialog box is active. Who’s got the focus? A particular keystroke has only a single destination, which is of type Control or a descendant of Control, such as Form. The object that has input focus receives a keystroke event. A form has input focus when it is the active form. Active form is usually the topmost form on the desktop. Active form is available from the only static property implemented by Form. Type : Form Property : ActiveForm Accessibility : get A form can attempt to activate itself by calling void Activate(). When a form changes to or from the Activated state it gets these events: Event Method Delegate Argument Activated OnActivated EventHandler EventArgs Deactivate OnDeactivate EventHandler EventArgs Keyboards and Characters Keyboard is: A collection of distinct physical keys A means of generating character codes (Unicode). Four groups of keys Toggle keys (Caps, Num, Scroll locks, Insert) Shift keys (Shift, Ctrl, Alt) Noncharacter keys (function, pause, del) Character keys (letter,no,Tab,Backspace,Enter,Esc) Keys Down and Keys Up Keystroke event handlers in your form class: Event Method Delegate Argument KeyDown OnKeyDown KeyEventHandler KeyEventArgs KeyUp OnKeyUp KeyEventHandler KeyEventArgs Event Overrides protected override void OnKeyDown(KeyEventArgs kea) { … } protected override void OnKeyUp (KeyEventArgs kea) { …} Void MyKeyDownHandler (object objSender, KeyEventsArg
您可能关注的文档
- QEMU平台构建基于PowerPC单核SoC 并运行DES程序.ppt
- Recycle 1 Read and say.ppt
- Research UsingLocal Gazetteers.ppt
- Section B(1a-2c).ppt
- Sobre Catalogação e Catálogo.ppt
- Sometimes happiness is just a matter of attitude adjustment..ppt
- Sound, Music and Religion.ppt
- spacewalk.ppt
- SPSS实用统计分析(三).ppt
- STEMI抗栓治疗---平衡获益与风险.ppt
- The Learning Never Stops!.ppt
- The necklace—Based on a story by Guy De Maupassant.ppt
- Topic Pollution in Cities.ppt
- Unit 12 My favorite subject is science.Section B (1a-4).ppt
- Unit 14 Zoology.ppt
- Unit 1Women of achievementUsing language.ppt
- Unit 2 Topic 1 I have a small nose Sectio.ppt
- Unit 20 Senior One.ppt
- Unit 3 Life in the futureUsing language.ppt
- Unit 3 Our Hobbies Topic 2 What sweet music!Section A.ppt
原创力文档

文档评论(0)