Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
nsKeyCode Struct Reference

#include <nsKeyCode.h>

List of all members.

Static Public Member Functions

static PRInt32 ConvertKeySymToVirtualKey (KeySym aKeySym)
static PRBool KeyCodeIsModifier (KeyCode aKeyCode)
static KeySym ConvertKeyCodeToKeySym (Display *aDisplay, KeyCode aKeyCode)

Detailed Description

Definition at line 46 of file nsKeyCode.h.


Member Function Documentation

KeySym nsKeyCode::ConvertKeyCodeToKeySym ( Display aDisplay,
KeyCode  aKeyCode 
) [static]

Definition at line 205 of file nsKeyCode.cpp.

{
  KeySym keysym = 0;

  keysym = XKeycodeToKeysym(aDisplay, aKeyCode, 0);

  return keysym;
}

Here is the caller graph for this function:

PRInt32 nsKeyCode::ConvertKeySymToVirtualKey ( KeySym  aKeySym) [static]

Definition at line 162 of file nsKeyCode.cpp.

{
  unsigned int i;
  unsigned int length = sizeof(nsKeycodes) / sizeof(struct nsKeyConverter);

  if (keysym >= XK_a && keysym <= XK_z)
    return keysym - XK_a + NS_VK_A;
  if (keysym >= XK_A && keysym <= XK_Z)
    return keysym - XK_A + NS_VK_A;

  for (i = 0; i < length; i++) 
  {
    if (nsKeycodes[i].keysym == keysym)
    {
      return(nsKeycodes[i].vkCode);
    }
  }
  
  return((int)0);
}

Here is the caller graph for this function:

PRBool nsKeyCode::KeyCodeIsModifier ( KeyCode  aKeyCode) [static]

Definition at line 185 of file nsKeyCode.cpp.

{
  if (aKeyCode == XK_Shift_L    ||
      aKeyCode == XK_Shift_R    ||
      aKeyCode == XK_Control_L  ||
      aKeyCode == XK_Control_R  ||
      aKeyCode == XK_Caps_Lock  ||
      aKeyCode == XK_Shift_Lock ||
      aKeyCode == XK_Meta_L     ||
      aKeyCode == XK_Meta_R     ||
      aKeyCode == XK_Alt_L      ||
      aKeyCode == XK_Alt_R)
  {
    return PR_TRUE;
  }

  return PR_FALSE;
}

Here is the caller graph for this function:


The documentation for this struct was generated from the following files: