oxwm

https://git.tonybtw.com/oxwm.git git://git.tonybtw.com/oxwm.git

Updated XF86 keys to camel case, and also added a whole lot more of 'em.

Commit
8351ba047d51859202461ac8cc06aa598bd621b9
Parent
a8b90f5
Author
Aaron Bush <theawpportunist@gmail.com>
Date
2025-12-15 22:18:53

Diff

diff --git a/src/keyboard/keysyms.rs b/src/keyboard/keysyms.rs
index 51d613f..12564b3 100644
--- a/src/keyboard/keysyms.rs
+++ b/src/keyboard/keysyms.rs
@@ -77,22 +77,65 @@ pub const XK_PERIOD: Keysym = 0x002e;
 pub const XK_SLASH: Keysym = 0x002f;
 pub const XK_PRINT: Keysym = 0xff61;
 
-pub const XK_AMPERSAND: Keysym = 0x26;
-pub const XK_AGRAVE: Keysym = 0xe0;
-pub const XK_CCEDILLA: Keysym = 0xe7;
-pub const XK_EGRAVE: Keysym = 0xe8;
-pub const XK_EACUTE: Keysym = 0xe9;
-pub const XK_PARENLEFT: Keysym = 0x28;
-pub const XK_PARENRIGHT: Keysym = 0x29;
-pub const XK_QUOTEDBL: Keysym = 0x22;
-pub const XK_UNDERSCORE: Keysym = 0x5f;
-pub const XK_HYPHEN: Keysym = 0xad;
-
+pub const XF86_AUDIO_MEDIA: Keysym = 0x1008ff32;
+pub const XF86_AUDIO_NEXT: Keysym = 0x1008ff17;
+pub const XF86_AUDIO_PAUSE: Keysym = 0x1008ff31;
+pub const XF86_AUDIO_PLAY: Keysym = 0x1008ff14;
+pub const XF86_AUDIO_PREV: Keysym = 0x1008ff16;
 pub const XF86_AUDIO_RAISE_VOLUME: Keysym = 0x1008ff13;
 pub const XF86_AUDIO_LOWER_VOLUME: Keysym = 0x1008ff11;
 pub const XF86_AUDIO_MUTE: Keysym = 0x1008ff12;
+pub const XF86_AUDIO_MIC_MUTE: Keysym = 0x1008ffb2;
+pub const XF86_AUDIO_RECORD: Keysym = 0x1008ff1c;
+pub const XF86_AUDIO_REWIND: Keysym = 0x1008ff3e;
+pub const XF86_AUDIO_STOP: Keysym = 0x1008ff15;
+pub const XF86_BACK: Keysym = 0x1008ff26;
+pub const XF86_CALCULATOR: Keysym = 0x1008ff1d;
+pub const XF86_CLOSE: Keysym = 0x1008ff56;
+pub const XF86_COPY: Keysym = 0x1008ff57;
+pub const XF86_CUT: Keysym = 0x1008ff58;
+pub const XF86_DOS: Keysym = 0x1008ff5a;
+pub const XF86_DISPLAY: Keysym = 0x1008ff59;
+pub const XF86_DOCUMENTS: Keysym = 0x1008ff5b;
+pub const XF86_EJECT: Keysym = 0x1008ff2c;
+pub const XF86_EXPLORER: Keysym = 0x1008ff5d;
+pub const XF86_FAVORITES: Keysym = 0x1008ff30;
+pub const XF86_FINANCE: Keysym = 0x1008ff3c;
+pub const XF86_FORWARD: Keysym = 0x1008ff27;
+pub const XF86_GAME: Keysym = 0x1008ff5e;
+pub const XF86_GO: Keysym = 0x1008ff5f;
+pub const XF86_HOME_PAGE: Keysym = 0x1008ff18;
+pub const XF86_MAIL: Keysym = 0x1008ff19;
+pub const XF86_MAIL_FORWARD: Keysym = 0x1008ff90;
+pub const XF86_MENU_KB: Keysym = 0x1008ff65;
+pub const XF86_MESSENGER: Keysym = 0x1008ff8e;
 pub const XF86_MON_BRIGHTNESS_UP: Keysym = 0x1008ff02;
 pub const XF86_MON_BRIGHTNESS_DOWN: Keysym = 0x1008ff03;
+pub const XF86_MY_COMPUTER: Keysym = 0x1008ff33;
+pub const XF86_NEW: Keysym = 0x1008ff68;
+pub const XF86_NEXT_VMODE: Keysym = 0x1008fe22;
+pub const XF86_PREV_VMODE: Keysym = 0x1008fe23;
+pub const XF86_OPEN: Keysym = 0x1008ff6b;
+pub const XF86_PASTE: Keysym = 0x1008ff6d;
+pub const XF86_PHONE: Keysym = 0x1008ff6e;
+pub const XF86_POWER_OFF: Keysym = 0x1008ff2a;
+pub const XF86_RELOAD: Keysym = 0x1008ff73;
+pub const XF86_REPLY: Keysym = 0x1008ff72;
+pub const XF86_ROTATE_WINDOWS: Keysym = 0x1008ff74;
+pub const XF86_SAVE: Keysym = 0x1008ff77;
+pub const XF86_SCREEN_SAVER: Keysym = 0x1008ff2d;
+pub const XF86_SCROLL_DOWN: Keysym = 0x1008ff79;
+pub const XF86_SCROLL_UP: Keysym = 0x1008ff78;
+pub const XF86_SEARCH: Keysym = 0x1008ff1b;
+pub const XF86_SEND: Keysym = 0x1008ff7b;
+pub const XF86_SHOP: Keysym = 0x1008ff36;
+pub const XF86_SLEEP: Keysym = 0x1008ff2f;
+pub const XF86_TASK_PANE: Keysym = 0x1008ff7f;
+pub const XF86_TOOLS: Keysym = 0x1008ff81;
+pub const XF86_WWW: Keysym = 0x1008ff2e;
+pub const XF86_WAKE_UP: Keysym = 0x1008ff2b;
+pub const XF86_WEBCAM: Keysym = 0x1008ff8f;
+pub const XF86_XFER: Keysym = 0x1008ff8a;
 
 pub fn keysym_from_str(s: &str) -> Option<Keysym> {
     match s {
@@ -171,21 +214,66 @@ pub fn keysym_from_str(s: &str) -> Option<Keysym> {
         "Period" => Some(XK_PERIOD),
         "Slash" => Some(XK_SLASH),
         "Print" => Some(XK_PRINT),
-        "Ampersand" => Some(XK_AMPERSAND),
-        "Agrave" => Some(XK_AGRAVE),
-        "Ccedilla" => Some(XK_CCEDILLA),
-        "Egrave" => Some(XK_EGRAVE),
-        "Eacute" => Some(XK_EACUTE),
-        "ParenLeft" => Some(XK_PARENLEFT),
-        "ParenRight" => Some(XK_PARENRIGHT),
-        "QuoteDouble" => Some(XK_QUOTEDBL),
-        "Underscore" => Some(XK_UNDERSCORE),
-        "Hyphen" => Some(XK_HYPHEN),
-        "AudioRaiseVolume" => Some(XF86_AUDIO_RAISE_VOLUME),
-        "AudioLowerVolume" => Some(XF86_AUDIO_LOWER_VOLUME),
-        "AudioMute" => Some(XF86_AUDIO_MUTE),
-        "MonBrightnessUp" => Some(XF86_MON_BRIGHTNESS_UP),
-        "MonBrightnessDown" => Some(XF86_MON_BRIGHTNESS_DOWN),
+
+        "XF86AudioMedia" => Some(XF86_AUDIO_MEDIA),
+        "XF86AudioNext" => Some(XF86_AUDIO_NEXT),
+        "XF86AudioPause" => Some(XF86_AUDIO_PAUSE),
+        "XF86AudioPlay" => Some(XF86_AUDIO_PLAY),
+        "XF86AudioPrev" => Some(XF86_AUDIO_PREV),
+        "XF86AudioRaiseVolume" => Some(XF86_AUDIO_RAISE_VOLUME),
+        "XF86AudioLowerVolume" => Some(XF86_AUDIO_LOWER_VOLUME),
+        "XF86AudioMute" => Some(XF86_AUDIO_MUTE),
+        "XF86AudioMicMute" => Some(XF86_AUDIO_MIC_MUTE),
+        "XF86AudioRecord" => Some(XF86_AUDIO_RECORD),
+        "XF86AudioRewind" => Some(XF86_AUDIO_REWIND),
+        "XF86AudioStop" => Some(XF86_AUDIO_STOP),
+        "XF86Back" => Some(XF86_BACK),
+        "XF86Calculator" => Some(XF86_CALCULATOR),
+        "XF86Close" => Some(XF86_CLOSE),
+        "XF86Copy" => Some(XF86_COPY),
+        "XF86Cut" => Some(XF86_CUT),
+        "XF86DOS" => Some(XF86_DOS),
+        "XF86Display" => Some(XF86_DISPLAY),
+        "XF86Documents" => Some(XF86_DOCUMENTS),
+        "XF86Eject" => Some(XF86_EJECT),
+        "XF86Explorer" => Some(XF86_EXPLORER),
+        "XF86Favorites" => Some(XF86_FAVORITES),
+        "XF86Finance" => Some(XF86_FINANCE),
+        "XF86Forward" => Some(XF86_FORWARD),
+        "XF86Game" => Some(XF86_GAME),
+        "XF86Go" => Some(XF86_GO),
+        "XF86HomePage" => Some(XF86_HOME_PAGE),
+        "XF86Mail" => Some(XF86_MAIL),
+        "XF86MailForward" => Some(XF86_MAIL_FORWARD),
+        "XF86MenuKB" => Some(XF86_MENU_KB),
+        "XF86Messenger" => Some(XF86_MESSENGER),
+        "XF86MonBrightnessUp" => Some(XF86_MON_BRIGHTNESS_UP ),
+        "XF86MonBrightnessDown" => Some(XF86_MON_BRIGHTNESS_DOWN),
+        "XF86MyComputer" => Some(XF86_MY_COMPUTER),
+        "XF86New" => Some(XF86_NEW),
+        "XF86Next_VMode" => Some(XF86_NEXT_VMODE),
+        "XF86Prev_VMode" => Some(XF86_PREV_VMODE),
+        "XF86Open" => Some(XF86_OPEN),
+        "XF86Paste" => Some(XF86_PASTE),
+        "XF86Phone" => Some(XF86_PHONE),
+        "XF86PowerOff" => Some(XF86_POWER_OFF),
+        "XF86Reload" => Some(XF86_RELOAD),
+        "XF86Reply" => Some(XF86_REPLY),
+        "XF86RotateWindows" => Some(XF86_ROTATE_WINDOWS),
+        "XF86Save" => Some(XF86_SAVE),
+        "XF86ScreenSaver" => Some(XF86_SCREEN_SAVER),
+        "XF86ScrollDown" => Some(XF86_SCROLL_DOWN),
+        "XF86ScrollUp" => Some(XF86_SCROLL_UP),
+        "XF86Search" => Some(XF86_SEARCH),
+        "XF86Send" => Some(XF86_SEND),
+        "XF86Shop" => Some(XF86_SHOP),
+        "XF86Sleep" => Some(XF86_SLEEP),
+        "XF86TaskPane" => Some(XF86_TASK_PANE),
+        "XF86Tools" => Some(XF86_TOOLS),
+        "XF86WWW" => Some(XF86_WWW),
+        "XF86WakeUp" => Some(XF86_WAKE_UP),
+        "XF86WebCam" => Some(XF86_WEBCAM),
+        "XF86Xfer" => Some(XF86_XFER),
         _ => None,
     }
 }
@@ -231,21 +319,65 @@ pub fn format_keysym(keysym: Keysym) -> String {
         XK_APOSTROPHE => "'".to_string(),
         XK_BACKSLASH => "\\".to_string(),
         XK_PRINT => "Print".to_string(),
-        XK_AMPERSAND => "&".to_string(),
-        XK_AGRAVE => "à".to_string(),
-        XK_CCEDILLA => "ç".to_string(),
-        XK_EGRAVE => "è".to_string(),
-        XK_EACUTE => "é".to_string(),
-        XK_PARENLEFT => "(".to_string(),
-        XK_PARENRIGHT => ")".to_string(),
-        XK_QUOTEDBL => "\"".to_string(),
-        XK_UNDERSCORE => "_".to_string(),
-        XK_HYPHEN => "-".to_string(),
+        XF86_AUDIO_MEDIA => "Media".to_string(),
+        XF86_AUDIO_NEXT => "Next".to_string(),
+        XF86_AUDIO_PAUSE => "Pause".to_string(),
+        XF86_AUDIO_PLAY => "Play".to_string(),
+        XF86_AUDIO_PREV => "Prev".to_string(),
         XF86_AUDIO_RAISE_VOLUME => "Vol+".to_string(),
         XF86_AUDIO_LOWER_VOLUME => "Vol-".to_string(),
         XF86_AUDIO_MUTE => "Mute".to_string(),
+        XF86_AUDIO_MIC_MUTE => "MicMute".to_string(),
+        XF86_AUDIO_RECORD => "Record".to_string(),
+        XF86_AUDIO_REWIND => "Rewind".to_string(),
+        XF86_AUDIO_STOP => "Stop".to_string(),
+        XF86_BACK => "Back".to_string(),
+        XF86_CALCULATOR => "Calculator".to_string(),
+        XF86_CLOSE => "Close".to_string(),
+        XF86_COPY => "Copy".to_string(),
+        XF86_CUT => "Cut".to_string(),
+        XF86_DOS => "DOS".to_string(),
+        XF86_DISPLAY => "Display".to_string(),
+        XF86_DOCUMENTS => "Documents".to_string(),
+        XF86_EJECT => "Eject".to_string(),
+        XF86_EXPLORER => "Explorer".to_string(),
+        XF86_FAVORITES => "Favorites".to_string(),
+        XF86_FINANCE => "Finance".to_string(),
+        XF86_FORWARD => "Forward".to_string(),
+        XF86_GAME => "Game".to_string(),
+        XF86_GO => "Go".to_string(),
+        XF86_HOME_PAGE => "HomePage".to_string(),
+        XF86_MAIL => "Mail".to_string(),
+        XF86_MAIL_FORWARD => "MailForward".to_string(),
+        XF86_MENU_KB => "MenuKB".to_string(),
+        XF86_MESSENGER => "Messenger".to_string(),
         XF86_MON_BRIGHTNESS_UP => "Bright+".to_string(),
         XF86_MON_BRIGHTNESS_DOWN => "Bright-".to_string(),
+        XF86_MY_COMPUTER => "MyComputer".to_string(),
+        XF86_NEW => "New".to_string(),
+        XF86_NEXT_VMODE => "NextVMode".to_string(),
+        XF86_PREV_VMODE => "PrevVMode".to_string(),
+        XF86_OPEN => "Open".to_string(),
+        XF86_PASTE => "Paste".to_string(),
+        XF86_PHONE => "Phone".to_string(),
+        XF86_POWER_OFF => "PowerOff".to_string(),
+        XF86_RELOAD => "Reload".to_string(),
+        XF86_REPLY => "Reply".to_string(),
+        XF86_ROTATE_WINDOWS => "RotateWindows".to_string(),
+        XF86_SAVE => "Save".to_string(),
+        XF86_SCREEN_SAVER => "ScreenSaver".to_string(),
+        XF86_SCROLL_DOWN => "ScrollDown".to_string(),
+        XF86_SCROLL_UP => "ScrollUp".to_string(),
+        XF86_SEARCH => "Search".to_string(),
+        XF86_SEND => "Send".to_string(),
+        XF86_SHOP => "Shop".to_string(),
+        XF86_SLEEP => "Sleep".to_string(),
+        XF86_TASK_PANE => "TaskPane".to_string(),
+        XF86_TOOLS => "Tools".to_string(),
+        XF86_WWW => "WWW".to_string(),
+        XF86_WAKE_UP => "WakeUp".to_string(),
+        XF86_WEBCAM => "WebCam".to_string(),
+        XF86_XFER => "Xfer".to_string(),
         XK_A..=XK_Z => {
             let ch = (keysym - XK_A + b'A' as u32) as u8 as char;
             ch.to_string()