virtualkeyboard_layout_t QQnxVirtualKeyboardBps::keyboardLayout() const { switch (keyboardMode()) { case Url: return VIRTUALKEYBOARD_LAYOUT_URL; case Email: return VIRTUALKEYBOARD_LAYOUT_EMAIL; case Web: return VIRTUALKEYBOARD_LAYOUT_WEB; case NumPunc: return VIRTUALKEYBOARD_LAYOUT_NUM_PUNC; case Number: return VIRTUALKEYBOARD_LAYOUT_NUMBER; case Symbol: return VIRTUALKEYBOARD_LAYOUT_SYMBOL; case Phone: return VIRTUALKEYBOARD_LAYOUT_PHONE; case Pin: return VIRTUALKEYBOARD_LAYOUT_PIN; case Password: return VIRTUALKEYBOARD_LAYOUT_PASSWORD; #if defined(Q_OS_BLACKBERRY) #if BBNDK_VERSION_AT_LEAST(10, 2, 1) case Alphanumeric: return VIRTUALKEYBOARD_LAYOUT_ALPHANUMERIC; #endif #endif case Default: // fall through default: return VIRTUALKEYBOARD_LAYOUT_DEFAULT; } return VIRTUALKEYBOARD_LAYOUT_DEFAULT; }
bool QQnxVirtualKeyboardPps::showKeyboard() { qVirtualKeyboardDebug() << Q_FUNC_INFO; // Try to connect. if (m_fd == -1 && !connect()) return false; // NOTE: This must be done everytime the keyboard is shown even if there is no change because // hiding the keyboard wipes the setting. applyKeyboardModeOptions(keyboardMode()); if (isVisible()) return true; pps_encoder_reset(m_encoder); // Send the show message. pps_encoder_add_string(m_encoder, "msg", "show"); if (::write(m_fd, pps_encoder_buffer(m_encoder), pps_encoder_length(m_encoder)) == -1) { close(); return false; } pps_encoder_reset(m_encoder); // Return true if no error occurs. Sizing response will be triggered when confirmation of // the change arrives. return true; }
const char* QQnxVirtualKeyboardPps::keyboardModeStr() const { switch (keyboardMode()) { case Url: return "url"; case Email: return "email"; case Web: return "web"; case NumPunc: return "num_punc"; case Number: return "number"; case Symbol: return "symbol"; case Phone: return "phone"; case Pin: return "pin"; case Password: return "password"; case Alphanumeric: return "alphanumeric"; case Default: return "default"; } return ""; }
void QQnxVirtualKeyboardBps::applyKeyboardOptions() { virtualkeyboard_layout_t layout = keyboardLayout(); virtualkeyboard_enter_t enter = enterKey(); qVirtualKeyboardDebug() << Q_FUNC_INFO << "mode=" << keyboardMode() << "enterKey=" << enterKeyType(); virtualkeyboard_change_options(layout, enter); }
bool QBBVirtualKeyboardBps::showKeyboard() { #if defined(QBBVIRTUALKEYBOARD_DEBUG) qDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); #endif // They keyboard's mode is global between applications, we have to set it each time if (!isVisible()) applyKeyboardMode(keyboardMode()); virtualkeyboard_show(); return true; }
void Util::setKeyboardMode(int mode) { if (mode == keyboardMode()) { return; } QString modeString; switch(mode) { case KeyboardFade: modeString = "fade"; break; case KeyboardMove: modeString = "move"; break; case KeyboardOff: default: modeString = "off"; } setSettingsValue("ui/vkbShowMethod", modeString); emit keyboardModeChanged(); }