Remote: forward the physical keyboard and hide the phone OSK while typing
CI / test (push) Failing after 1m7s
CI / test (push) Failing after 1m7s
The web UI now sends key events without opening the KB bar, and releases held keys on blur, hide or disconnect. The first remote keystroke (web or VNC) turns the on-screen keyboard off; it comes back when the last typing client disconnects, unless the user toggled it by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5e62f1b8cb
commit
0356413bb2
7 files changed
+411
-26
No files matched your search
@@ -89,6 +89,8 @@ static const KeyMapEntry special_keys[] = {
|
||||
{ 0xFFE5u, 58u, 0, 2 }, /* Caps_Lock */
|
||||
{ 0xFF7Fu, 69u, 0, 0 }, /* Num_Lock */
|
||||
{ 0xFF67u, 127u, 0, 0 }, /* Menu */
|
||||
{ 0xFF61u, 99u, 0, 0 }, /* Print / SysRq */
|
||||
{ 0xFF13u, 119u, 0, 0 }, /* Pause */
|
||||
/* Media / Android hardware keys */
|
||||
{ 0x1008FF11u, 114u, 0, 0 }, /* XF86AudioLowerVolume */
|
||||
{ 0x1008FF12u, 113u, 0, 0 }, /* XF86AudioMute */
|
||||
@@ -179,6 +181,27 @@ static void flush_unicode_run(CtlConn *ctl, const uint8_t *buf, size_t len) {
|
||||
ctl_fire(ctl, cmd);
|
||||
}
|
||||
|
||||
void remote_send_codepoint(CtlConn *ctl, uint32_t uc) {
|
||||
uint8_t u8[8];
|
||||
size_t n = 0;
|
||||
if (uc < 0x80u) {
|
||||
u8[n++] = (uint8_t)uc;
|
||||
} else if (uc < 0x800u) {
|
||||
u8[n++] = (uint8_t)(0xC0u | (uc >> 6));
|
||||
u8[n++] = (uint8_t)(0x80u | (uc & 0x3Fu));
|
||||
} else if (uc < 0x10000u) {
|
||||
u8[n++] = (uint8_t)(0xE0u | (uc >> 12));
|
||||
u8[n++] = (uint8_t)(0x80u | ((uc >> 6) & 0x3Fu));
|
||||
u8[n++] = (uint8_t)(0x80u | (uc & 0x3Fu));
|
||||
} else if (uc <= 0x10FFFFu) {
|
||||
u8[n++] = (uint8_t)(0xF0u | (uc >> 18));
|
||||
u8[n++] = (uint8_t)(0x80u | ((uc >> 12) & 0x3Fu));
|
||||
u8[n++] = (uint8_t)(0x80u | ((uc >> 6) & 0x3Fu));
|
||||
u8[n++] = (uint8_t)(0x80u | (uc & 0x3Fu));
|
||||
}
|
||||
if (n > 0) flush_unicode_run(ctl, u8, n);
|
||||
}
|
||||
|
||||
void remote_send_utf8_text(CtlConn *ctl, const char *utf8) {
|
||||
const uint8_t *p = (const uint8_t *)utf8;
|
||||
uint8_t run[900];
|
||||
|
||||
Reference in new issue
Block a user