ref: 4f8b668dae15c863d7e92f158928d5f62faab3d9
parent: 7a1fe6d6eca745009d9be9ad6f16e45ed2a511ab
author: Jacob Moody <moody@posixcafe.org>
date: Wed Oct 5 01:07:23 EDT 2022
gui-wl: support media keys
--- a/gui-wl/wl-cb.c
+++ b/gui-wl/wl-cb.c
@@ -255,6 +255,24 @@
case XKB_KEY_F12:
utf32 = KF|(keysym - XKB_KEY_F1 + 1);
break;
+ case XKB_KEY_XF86AudioPrev:
+ utf32 = Ksbwd;
+ break;
+ case XKB_KEY_XF86AudioNext:
+ utf32 = Ksfwd;
+ break;
+ case XKB_KEY_XF86AudioPlay:
+ utf32 = Kpause;
+ break;
+ case XKB_KEY_XF86AudioLowerVolume:
+ utf32 = Kvoldn;
+ break;
+ case XKB_KEY_XF86AudioRaiseVolume:
+ utf32 = Kvolup;
+ break;
+ case XKB_KEY_XF86AudioMute:
+ utf32 = Kmute;
+ break;
default:
utf32 = xkb_keysym_to_utf32(keysym);
break;
--- a/include/keyboard.h
+++ b/include/keyboard.h
@@ -1,3 +1,6 @@
+#pragma src "/sys/src/libdraw"
+#pragma lib "libdraw.a"
+
typedef struct Keyboardctl Keyboardctl;
typedef struct Channel Channel;
@@ -40,6 +43,14 @@
Kscroll= KF|0x19,
Kscrolloneup= KF|0x20,
Kscrollonedown= KF|0x21,
+
+ /* multimedia keys - no refunds */
+ Ksbwd= KF|0x22,
+ Ksfwd= KF|0x23,
+ Kpause= KF|0x24,
+ Kvoldn= KF|0x25,
+ Kvolup= KF|0x26,
+ Kmute= KF|0x27,
Ksoh= 0x01,
Kstx= 0x02,