bluetooth: fix BLE/HID keyboard & mouse pairing, auto-bypass T9 on external keyboard, and show mouse cursor

This commit is contained in:
Luxferre committed 2026-11-03 20:24:54 +02:00
1 parent b9e7c6847b
commit 02ce3ab1f4
67 files changed
+1227 -293

No files matched your search

+27 -30
View File
@@ -458,7 +458,11 @@ int runContactsApp(int argc, char** argv) {
const char* modeNames[4] = {"[Abc]", "[ABC]", "[abc]", "[123]"};
std::string modeBadge =
(editField == 0) ? modeNames[static_cast<int>(caseMode)] : "[+0-9]";
(editField == 0)
? (isExternalKeyboardActive()
? "[KBD]"
: modeNames[static_cast<int>(caseMode)])
: "[+0-9]";
int mw = pangoWidth(layoutSmall, modeBadge);
drawPango(layoutSmall, &colYellow, kWinWidth - mw - 6, 0, kHeaderH,
modeBadge);
@@ -1208,7 +1212,7 @@ int runContactsApp(int argc, char** argv) {
}
}
} else if (ev.type == KeyPress) {
KeySym sym = XLookupKeysym(&ev.xkey, 0);
KeySym sym = XLookupKeysym(&ev.xkey, (ev.xkey.state & ShiftMask) ? 1 : 0);
bool isLeftSoft = (sym == XK_Menu || sym == XF86XK_KbdLcdMenu1 ||
ev.xkey.keycode == 135);
bool isRightSoft = (sym == XF86XK_Back || sym == XF86XK_KbdLcdMenu2 ||
@@ -1389,36 +1393,29 @@ int runContactsApp(int argc, char** argv) {
} else if (mode == ViewMode::Edit) {
char dialCh = mapDialKey(sym, ev.xkey.keycode, ev.xkey.state);
if (editField == 0) {
if (dialCh == '#') {
caseMode = static_cast<TextCaseMode>(
(static_cast<int>(caseMode) + 1) % 4);
lastTapDigit = -1;
render();
continue;
}
if (dialCh == '*') {
editName.push_back(' ');
lastTapDigit = -1;
render();
continue;
}
if (dialCh >= '0' && dialCh <= '9') {
handleMultiTapNameChar(dialCh - '0');
render();
continue;
}
if (sym >= XK_a && sym <= XK_z) {
char c = static_cast<char>('a' + (sym - XK_a));
if (ev.xkey.state & ShiftMask) {
c = static_cast<char>(std::toupper(static_cast<unsigned char>(c)));
if (!isExternalKeyboardActive()) {
if (dialCh == '#') {
caseMode = static_cast<TextCaseMode>(
(static_cast<int>(caseMode) + 1) % 4);
lastTapDigit = -1;
render();
continue;
}
if (dialCh == '*') {
editName.push_back(' ');
lastTapDigit = -1;
render();
continue;
}
if (dialCh >= '0' && dialCh <= '9') {
handleMultiTapNameChar(dialCh - '0');
render();
continue;
}
editName.push_back(c);
lastTapDigit = -1;
render();
continue;
}
if (sym == XK_space) {
editName.push_back(' ');
if (sym >= 0x20 && sym <= 0x7e &&
!(ev.xkey.state & (ControlMask | Mod1Mask))) {
editName.push_back(static_cast<char>(sym));
lastTapDigit = -1;
render();
continue;