Skip to content

Commit

Permalink
chore: add option to disable virtual keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Aug 26, 2023
1 parent e6de1a3 commit 5fbc726
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pages/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ const Terminal: VFC = () => {
}

const openKeyboard = () => {
if (config?.disable_virtual_keyboard) {
setFocusToTerminal();
return;
}

const fakeInput = fakeInputRef.current as any
console.log('fakeInput', fakeInput)
if (fakeInput?.m_elInput) {
Expand Down
20 changes: 20 additions & 0 deletions src/pages/settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ import TerminalGlobal from "../../common/global";
})
}

const setDisableVirtualKeyboard = async (disabled: boolean) => {
await appendConfig({
disable_virtual_keyboard: disabled,
})
}

useEffect(() => {
console.log('Fetching Settings')

Expand Down Expand Up @@ -148,6 +154,20 @@ import TerminalGlobal from "../../common/global";
bottomSeparator={"none"} />
</div>
</Focusable>
<Focusable
style={{ display: 'flex', justifyContent: 'space-between', gap: '1rem' }}>
<div>
<div className={staticClasses.Text}>Disable Virtual Keyboard</div>
<div className={staticClasses.Label}>Use if you are using external keyboard and don't want virtual keyboard to popup.<br />(Keyboard button will just move focus to terminal)</div>
</div>
<div style={{ minWidth: '200px' }}>
<ToggleField
disabled={false}
checked={config?.disable_virtual_keyboard ?? false}
onChange={(e) => {setDisableVirtualKeyboard(e)}}
bottomSeparator={"none"} />
</div>
</Focusable>
</Focusable>
);
};
Expand Down

0 comments on commit 5fbc726

Please sign in to comment.