Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The input method mode should be set physical keyboard when necessary #1087

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/ui/virtualkeyboard/virtualkeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class VirtualKeyboardService

void showVirtualKeyboard() { parent_->showVirtualKeyboardForcibly(); }

void hideVirtualKeyboard() { parent_->hideVirtualKeyboard(); }
void hideVirtualKeyboard() { parent_->hideVirtualKeyboardForcibly(); }

void toggleVirtualKeyboard() { parent_->toggleVirtualKeyboard(); }

Expand Down Expand Up @@ -323,13 +323,25 @@ void VirtualKeyboard::showVirtualKeyboardForcibly() {
showVirtualKeyboard();
}

void VirtualKeyboard::hideVirtualKeyboardForcibly() {
if (!available_) {
return;
}

hideVirtualKeyboard();

if (!instance_->virtualKeyboardAutoShow()) {
instance_->setInputMethodMode(InputMethodMode::PhysicalKeyboard);
}
}

void VirtualKeyboard::toggleVirtualKeyboard() {
if (!available_) {
return;
}

if (visible_) {
hideVirtualKeyboard();
hideVirtualKeyboardForcibly();
} else {
showVirtualKeyboardForcibly();
}
Expand Down
1 change: 1 addition & 0 deletions src/ui/virtualkeyboard/virtualkeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class VirtualKeyboard : public VirtualKeyboardUserInterface {
void hideVirtualKeyboard() override;

void showVirtualKeyboardForcibly();
void hideVirtualKeyboardForcibly();
void toggleVirtualKeyboard();

void updateInputPanel(InputContext *inputContext);
Expand Down
Loading