Fix global Power menu key handling, SIP G.711 audio routing, Webarchy audio playback, and ReMEdy Call menu key

This commit is contained in:
Luxferre committed 2026-10-31 19:39:28 +02:00
1 parent d7335b5ebe
commit 0af39d9fa0
76 files changed
+506 -104

No files matched your search

+14
View File
@@ -2138,6 +2138,20 @@ int main(int argc, char** argv) {
unsigned int kc = ev.xkey.keycode;
KeySym sym = XLookupKeysym(&ev.xkey, 0);
if (isPress && (sym == XF86XK_PowerOff || kc == 124)) {
unfocusWindow(false);
int64_t tNow = nowMs();
writeSoftkeySuppress(tNow + 500);
overlayCooldownUntilMs = tNow + 500;
int ffd = ::open("/tmp/dwm_plugin_dmenu.fifo",
O_WRONLY | O_NONBLOCK | O_CLOEXEC);
if (ffd >= 0) {
(void)::write(ffd, "OPEN power\n", 11);
::close(ffd);
}
continue;
}
if (isPress && (sym == XF86XK_AudioLowerVolume ||
sym == XF86XK_AudioRaiseVolume)) {
audioOut.adjustSpeakerVol(
+32 -5
View File
@@ -143,7 +143,7 @@ static std::string keysymLabel(KeySym ks) {
case XK_Super_L:
case XK_F1: return "LSoft";
case XK_F2: return "RSoft";
case XK_Escape: return "End/Esc";
case XK_Escape: return "Call/Esc";
case XK_asterisk: return "* (Star)";
case XK_numbersign: return "# (Hash)";
default: {
@@ -1211,15 +1211,37 @@ class RemedyEmulator {
}
bool handleKeyPress(KeySym ks, unsigned int keycode = 0) {
// Normalize Nokia 8110 4G hardware softkeys & End key
// Normalize Nokia 8110 4G hardware softkeys, Call key, & End/Power key
if (keycode == 135 || ks == XK_Menu || ks == XF86XK_KbdLcdMenu1 ||
ks == _EVDEVK(0x246)) {
ks = XK_F1;
} else if (keycode == 166 || ks == XF86XK_Back || ks == XF86XK_KbdLcdMenu2 ||
ks == _EVDEVK(0x247)) {
ks = XK_F2;
} else if (keycode == 124 || ks == XF86XK_PowerOff) {
} else if (keycode == 169 || ks == XF86XK_Phone ||
ks == XF86XK_PickupPhone || ks == _EVDEVK(0x0e7)) {
ks = XK_Escape;
} else if (keycode == 124 || ks == XF86XK_PowerOff) {
cldcRuntime.sound.setPaused(true);
ungrabKeyboard();
int ffd = ::open("/tmp/dwm_plugin_dmenu.fifo",
O_WRONLY | O_NONBLOCK | O_CLOEXEC);
if (ffd >= 0) {
(void)::write(ffd, "OPEN power\n", 11);
::close(ffd);
} else {
std::system("dmenu power >/dev/null 2>&1");
}
usleep(120000);
for (int wait = 0; wait < 600; ++wait) {
if (::access("/tmp/dwm_plugin_dmenu.active", F_OK) != 0) break;
usleep(50000);
}
XRaiseWindow(neoWin.dpy, neoWin.win);
XSetInputFocus(neoWin.dpy, neoWin.win, RevertToParent, CurrentTime);
grabKeyboard();
appCtx.repaintPending = true;
return true;
}
if (ks == XF86XK_AudioLowerVolume || ks == XF86XK_AudioRaiseVolume) {
@@ -1329,8 +1351,9 @@ class RemedyEmulator {
return true;
}
if (mode == EmuUiMode::PAUSED) {
if (softIdx == 2) {
if (softIdx == 1 || softIdx == 2) {
mode = hasLoadedMidlet ? EmuUiMode::RUNNING : EmuUiMode::BROWSER;
if (mode == EmuUiMode::BROWSER) renderBrowserMenu();
appCtx.repaintPending = true;
}
return true;
@@ -1397,6 +1420,7 @@ class RemedyEmulator {
}
if (ks == XK_Escape) {
mode = hasLoadedMidlet ? EmuUiMode::RUNNING : EmuUiMode::BROWSER;
if (mode == EmuUiMode::BROWSER) renderBrowserMenu();
appCtx.repaintPending = true;
return true;
}
@@ -1493,7 +1517,10 @@ class RemedyEmulator {
}
}
} else if (ks == XK_Escape) {
return false;
pauseSel = 0;
pauseScroll = 0;
mode = EmuUiMode::PAUSED;
renderPauseMenu();
}
return true;
}
+10
View File
@@ -993,6 +993,16 @@ int main() {
continue;
}
if (evType == NEO_EV_CLOSE_REQ) {
if (neoui_event_keysym() == XF86XK_PowerOff ||
neoui_event_keycode() == 124) {
::usleep(80000);
while (::access("/tmp/dwm_plugin_dmenu.active", F_OK) == 0) {
::usleep(50000);
}
neoui_raise_and_grab();
render();
continue;
}
gRunning = 0;
break;
}