Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

scim::KeyEvent Struct Reference
[Helper]

The class to store a keyboard event. More...

#include <scim_event.h>

List of all members.

Public Member Functions

 KeyEvent (int c=0, int m=0)
 Constructor.

bool empty () const
 Check if this KeyEvent is empty.

char get_ascii_code () const
 Get the ascii code of this key event.

bool is_shift_down () const
 Check if the shift key is pressed down.

bool is_lock_down () const
 Check if the lock key is pressed down.

bool is_control_down () const
 Check if the ctrl key is pressed down.

bool is_alt_down () const
 Check if the alt key is pressed down.

bool is_mod1_down () const
 Check if the mod1 key is pressed down.

bool is_mod2_down () const
 Check if the mod2 key is pressed down.

bool is_mod3_down () const
 Check if the mod3 key is pressed down.

bool is_mod4_down () const
 Check if the mod4 key is pressed down.

bool is_mod5_down () const
 Check if the mod5 key is pressed down.

bool is_num_lock_down () const
 Check if the num lock key is pressed down.

bool is_caps_lock_down () const
 Check if the caps lock key is pressed down.

bool is_scroll_lock_down () const
 Check if the scroll lock key is pressed down.

bool is_key_press () const
 Check if it's a key press event.

bool is_key_release () const
 Check if it's a key release event.

bool operator== (const KeyEvent &key) const
 Compare two key events.

bool operator< (const KeyEvent &key) const
 Compare two key events.


Public Attributes

int code
int mask


Detailed Description

The class to store a keyboard event.

A keyboard event contains a key code and a set of key masks. The key masks indicate which modifier keys are pressed down and if it's a key release event.

Definition at line 322 of file scim_event.h.


Constructor & Destructor Documentation

scim::KeyEvent::KeyEvent int  c = 0,
int  m = 0
[inline]
 

Constructor.

Parameters:
c - the key code.
m - the key masks.

Definition at line 332 of file scim_event.h.

References code, and mask.


Member Function Documentation

bool scim::KeyEvent::empty  )  const [inline]
 

Check if this KeyEvent is empty.

Returns:
true if this is a empty event.

Definition at line 339 of file scim_event.h.

References code, and mask.

char scim::KeyEvent::get_ascii_code  )  const
 

Get the ascii code of this key event.

Not all key events have ascii codes.

Returns:
the ascii code of this key event. Zero means no ascii code.

bool scim::KeyEvent::is_shift_down  )  const [inline]
 

Check if the shift key is pressed down.

Definition at line 354 of file scim_event.h.

References mask, and scim::SCIM_KEY_ShiftMask.

bool scim::KeyEvent::is_lock_down  )  const [inline]
 

Check if the lock key is pressed down.

Definition at line 359 of file scim_event.h.

References mask, and scim::SCIM_KEY_LockMask.

bool scim::KeyEvent::is_control_down  )  const [inline]
 

Check if the ctrl key is pressed down.

Definition at line 364 of file scim_event.h.

References mask, and scim::SCIM_KEY_ControlMask.

bool scim::KeyEvent::is_alt_down  )  const [inline]
 

Check if the alt key is pressed down.

Definition at line 369 of file scim_event.h.

References is_mod1_down().

bool scim::KeyEvent::is_mod1_down  )  const [inline]
 

Check if the mod1 key is pressed down.

Definition at line 374 of file scim_event.h.

References mask, and scim::SCIM_KEY_Mod1Mask.

Referenced by is_alt_down().

bool scim::KeyEvent::is_mod2_down  )  const [inline]
 

Check if the mod2 key is pressed down.

Definition at line 379 of file scim_event.h.

References mask, and scim::SCIM_KEY_Mod2Mask.

bool scim::KeyEvent::is_mod3_down  )  const [inline]
 

Check if the mod3 key is pressed down.

Definition at line 384 of file scim_event.h.

References mask, and scim::SCIM_KEY_Mod3Mask.

bool scim::KeyEvent::is_mod4_down  )  const [inline]
 

Check if the mod4 key is pressed down.

Definition at line 389 of file scim_event.h.

References mask, and scim::SCIM_KEY_Mod4Mask.

bool scim::KeyEvent::is_mod5_down  )  const [inline]
 

Check if the mod5 key is pressed down.

Definition at line 394 of file scim_event.h.

References mask, and scim::SCIM_KEY_Mod5Mask.

bool scim::KeyEvent::is_num_lock_down  )  const [inline]
 

Check if the num lock key is pressed down.

Definition at line 399 of file scim_event.h.

References mask, and scim::SCIM_KEY_NumLockMask.

bool scim::KeyEvent::is_caps_lock_down  )  const [inline]
 

Check if the caps lock key is pressed down.

Definition at line 404 of file scim_event.h.

References mask, and scim::SCIM_KEY_CapsLockMask.

bool scim::KeyEvent::is_scroll_lock_down  )  const [inline]
 

Check if the scroll lock key is pressed down.

Definition at line 409 of file scim_event.h.

References mask, and scim::SCIM_KEY_ScrollLockMask.

bool scim::KeyEvent::is_key_press  )  const [inline]
 

Check if it's a key press event.

Definition at line 414 of file scim_event.h.

References mask, and scim::SCIM_KEY_ReleaseMask.

bool scim::KeyEvent::is_key_release  )  const [inline]
 

Check if it's a key release event.

Definition at line 419 of file scim_event.h.

References mask, and scim::SCIM_KEY_ReleaseMask.

bool scim::KeyEvent::operator== const KeyEvent key  )  const [inline]
 

Compare two key events.

Returns:
true if they are equal.

Definition at line 425 of file scim_event.h.

References code, and mask.

bool scim::KeyEvent::operator< const KeyEvent key  )  const [inline]
 

Compare two key events.

This operator is mainly for sorting.

Returns:
true if the first is smaller.

Definition at line 436 of file scim_event.h.

References code, and mask.


Member Data Documentation

int scim::KeyEvent::code
 

key code

Definition at line 324 of file scim_event.h.

Referenced by empty(), KeyEvent(), operator<(), and operator==().

int scim::KeyEvent::mask
 

modifier keys' mask

Definition at line 325 of file scim_event.h.

Referenced by empty(), is_caps_lock_down(), is_control_down(), is_key_press(), is_key_release(), is_lock_down(), is_mod1_down(), is_mod2_down(), is_mod3_down(), is_mod4_down(), is_mod5_down(), is_num_lock_down(), is_scroll_lock_down(), is_shift_down(), KeyEvent(), operator<(), and operator==().


The documentation for this struct was generated from the following file:
Generated on Fri May 7 17:27:27 2004 for scim by doxygen 1.3.6