logo

The KeyboardListener is a static class that allows registering a number of event handlers that you want to get called in case some keyboard key is pressed or released. The nice thing is that this KeyboardListener is also active in case the parent application is running in the back. More...

Classes

class  ListeningWindow
 A ListeningWindow object is a Window that intercepts Keyboard events. More...
 
class  UniversalKeyEventArgs
 An instance of this class is passed when Keyboard events are fired by the KeyboardListener. More...
 

Public Member Functions

 KeyboardListener ()
 Initializes a new instance of the KeyboardListener class. More...
 

Events

EventHandler s_KeyEventHandler
 For every application thread that is interested in keyboard events an EventHandler can be added to this variable More...
 

Private Member Functions

void KeyHandler (ushort key, uint msg)
 The function that will handle all keyboard activity signaled by the ListeningWindow. In this context handling means calling all registered subscribers for every key pressed / released. More...
 

Static Private Attributes

static ListeningWindow s_Listener
 The Window that intercepts Keyboard messages More...
 

Detailed Description

Constructor & Destructor Documentation

NoteFly.KeyboardListener.KeyboardListener ( )

Member Function Documentation

void NoteFly.KeyboardListener.KeyHandler ( ushort  key,
uint  msg 
)
private

Inside this method the events could also be fired by calling s_KeyEventHandler(null,new KeyEventArgs(key,msg)) However, in case one of the registered subscribers throws an exception, execution of the non-executed subscribers is cancelled.

Parameters
keyKey
msgMsg

Member Data Documentation

ListeningWindow NoteFly.KeyboardListener.s_Listener
staticprivate

Event Documentation

EventHandler NoteFly.KeyboardListener.s_KeyEventHandler