/** Parse the JWM configuration. */ void ParseConfig(const char *fileName) { if(!ParseFile(fileName, 0)) { if(JUNLIKELY(!ParseFile(SYSTEM_CONFIG, 0))) { ParseError(NULL, "could not open %s or %s", fileName, SYSTEM_CONFIG); } } ValidateTrayButtons(); ValidateKeys(); }
void XKControl_Keyboard::PressSelectedKey() { KeyItem tmpKey = (KeyItem) m_KeyboardItemsMap[m_ActiveControlIndex]; string CurrentString = m_EditBox->GetText(); string AppString; INT CursorPos = m_EditBox->GetCursorPosition(); KEY_ITEM_TYPE KeyType = tmpKey.ItemType; if (m_Shift) AppString = tmpKey.ShiftStringValue; else AppString = tmpKey.NormalStringValue; switch (KeyType) { case (NORMAL_KEY): case (SPECIAL_KEY): CurrentString.insert(CursorPos, AppString); CursorPos++; break; case (CTRL_BACKSPACE_KEY): if (((UINT)CursorPos<CurrentString.length()) && (CurrentString.length() > 0)) CurrentString.erase(CursorPos, 1); else if (CurrentString.length() > 0) CurrentString.erase(CursorPos-1, 1); break; case (CTRL_MOVE_LEFT_KEY): CursorPos--; break; case (CTRL_MOVE_RIGHT_KEY): CursorPos++; break; case (CTRL_SHIFT_KEY): m_Shift = !m_Shift; ValidateKeys(); break; } SetText(CurrentString); m_EditBox->SetCursorPosition(CursorPos); }