minput_event_to_key(3m17n)
โจ NAME โจ
minput_event_to_key โ that's it bestie, that's the whole name. no little one-liner summary. she's mysterious. she's giving less-is-more. iconic behavior honestly ๐
๐ SYNOPSIS ๐
MSymbol minput_event_to_key (MFrame * frame, void * event)
๐ฆ DESCRIPTION ๐ฆ
okay so this one is a glow-up machine: it takes an event and turns it into an input key. literally. minput_event_to_key() hands back the input key that matches event on frame, and how it does that is a whole window system dependent situation โ the window system decides the vibe, not her ๐
so in the m17n-X library, event has to be a pointer to the structure XKeyEvent, and she handles it like this:
first things first โ the keysym name of event gets scooped up by the function XKeysymToString. then the name gets modified, and here's the tea:
- if the name is one of
'a'..'z'and event has a Shift modifier, the name gets converted to'A'..'Z'respectively, and that Shift modifier gets cleared. uppercase era โจ - if the name is one byte length and event has a Control modifier, that byte gets bitwise anded by
0x1Fand the Control modifier gets cleared. math moment ๐งฎ - if event still has modifiers after all that, the name gets preceded by these, in exactly this order:
'S-'(Shift)'C-'(Control)'M-'(Meta)'A-'(Alt)'G-'(AltGr)'s-'(Super)'H-'(Hyper)
fr fr, that order matters, don't shuffle it ๐
for instance, if the keysym name is 'a' and the event has Shift, Meta, and Hyper modifiers, the resulting name is 'M-H-A'. yes really, Shift dipped and the other two stayed, that's just how she rolls ๐ญ
and at last? a symbol who has the name gets returned. periodt. ๐
๐ COPYRIGHT ๐
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
okay that's the whole page, you're so welcome ๐ซถ this was Version 1.8.4, dated Mon Sep 25 2023, from the m17n library and she ate, no cap ๐โญ bye bestie, go convert some events ๐
๐ฆ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms