input_event Struct Reference

An input_event is _any_ kind of input from the user, including keys, screen resizes, etc. If NoKey is the type, then the event should be ignored. More...

#include <cursorwindow.h>

List of all members.

Public Types

enum  buttons {
  left = 1,
  right = 2,
  middle = 4
}
enum  type_constants {
  NoKey = 0,
  DataKey,
  FunctionKey,
  ResizeKey,
  ForceExitKey,
  MouseEvent
}
 

Symbolic names for event types.

More...

Public Member Functions

 input_event ()
 default constructor
 input_event (int type, int value, int row=0, int col=0)
 construct an event

Public Attributes

int col_
 valid only on mouse events
int row_
 valid only on mouse vents
int type_
 data key, function key, resize
int value_
 key value -- values are unique across function and data keys. value is the cursesinterface.h 'mouse_infostate_' and reflects a bit mask of the left,middle,right buttons are down flags... plus '@' -- so as to give a valid ascii char that is readable

Detailed Description

An input_event is _any_ kind of input from the user, including keys, screen resizes, etc. If NoKey is the type, then the event should be ignored.

Keys are categorized in to one of the type_constants described below. Further categorization of keys can be done using the CursorWindow::func -- which is a map of key values into logical rather than physical function keys. For example, there is a physical F1 function key, which is mapped to CursorWindow::key_f1. However, what does F1 mean? By default, it has no mapping to any edit function that would be used by a CursorWindow::dialog object. You could map key_f1 to something in your program using a switch statement -- or you could add a mapping between f1 and some standard edit function -- anything in the edit_func_names list or anything you add to that list.

Definition at line 273 of file cursorwindow.h.


Member Enumeration Documentation

enum buttons
Enumerator:
left 
right 
middle 

Definition at line 314 of file cursorwindow.h.

Symbolic names for event types.

Enumerator:
NoKey 

No key or other event actually read.

DataKey 

Normal ascii key read.

FunctionKey 

Function key read.

ResizeKey 

Window resized -- use size() to get info about the new < window size. Note that you will never get this event < if you use a resize_handler functor. See CursorWindow::resize_handler.

ForceExitKey 

exit the viewer and do not ask any stupid questions

MouseEvent 

Definition at line 293 of file cursorwindow.h.


Constructor & Destructor Documentation

input_event ( int  type,
int  value,
int  row = 0,
int  col = 0 
)

construct an event

Definition at line 321 of file cursorwindow.h.

input_event (  ) 

default constructor

Definition at line 329 of file cursorwindow.h.


Member Data Documentation

int col_

valid only on mouse events

Definition at line 312 of file cursorwindow.h.

int row_

valid only on mouse vents

Definition at line 311 of file cursorwindow.h.

int type_

data key, function key, resize

Definition at line 305 of file cursorwindow.h.

int value_

key value -- values are unique across function and data keys. value is the cursesinterface.h 'mouse_infostate_' and reflects a bit mask of the left,middle,right buttons are down flags... plus '@' -- so as to give a valid ascii char that is readable

Definition at line 306 of file cursorwindow.h.


The documentation for this struct was generated from the following file:
Generated on Wed Feb 29 22:53:47 2012 for CXXUtilities by  doxygen 1.6.3