minput_get_command(3m17n)
π minput_get_command β the m17n Library era π
okay bestie, sit down, hydrate, because we're about to get cozy with minput_get_command from the m17n library (manual page minput_get_command(3m17n), iykyk). it's giving "let me tell you everything about your input method commands" and honestly? iconic.
β¨ NAME β¨
minput_get_command β ...and that's literally it, the original left this one blank, no cap, the description slot is just vibes and empty space π
β¨ SYNOPSIS β¨
MPlist* minput_get_command (MSymbol language, MSymbol name, MSymbol
command)
β¨ DESCRIPTION β¨
@brief</ppurple> Get information about input method command(s). periodt.
so like, the minput_get_command() function returns info about the command command of the input method that's specified by language and name. and what even is an input method command, you ask? bestie it's a pseudo key event β a fake little key moment β to which one or more actual input key sequences are assigned. it's giving ghost key, it's giving proxy π
.
there are two kinds of commands, and you need to know both:
- global β has a global definition, and its description + key assignment may be inherited by a local command.
- local β every input method defines a local command with its own local key assignment. it may also declare a local command that inherits the definition of a global command of the same name. the way that's literally inheritance, we love a family tree π§.
now, the vibe check on which one you get back:
- If language is
#Mtand name is#Mnil, this function returns information about a global command. Otherwise, information about a local command is returned. - If command is
#Mnil, information about all commands is returned. (yes, all of them. she's thorough. main character energy.)
The return value is a well-formed plist (m17nPlist) of this format:
((NAME DESCRIPTION STATUS [KEYSEQ ...]) ...)
let's break down every single piece, no skipping, because we don't do that here:
NAMEis a symbol representing the command name.DESCRIPTIONis anM-textdescribing the command, orMnilif the command has no description.STATUSis a symbol representing how the key assignment is decided. The value isMnil(the default key assignment),Mcustomized(the key assignment is customized by per-user customization file), orMconfigured(the key assignment is set by the call ofminput_config_command()). For a local command only, it may also beMinherited(the key assignment is inherited from the corresponding global command).KEYSEQis a plist of one or more symbols representing a key sequence assigned to the command. If there's noKEYSEQ, the command is currently disabled (i.e. no key sequence can trigger actions of the command).
and one more lil detail bestie: if command is not Mnil, the first element of the returned plist contains the information about command.
β¨ RETURN VALUE β¨
- If the requested information was found, a pointer to a non-empty plist is returned. As the plist is kept in the library, the caller must not modify nor free it. (do not touch. hands off. she's not yours π«Ά)
- Otherwise (the specified input method or the specified command does not exist),
NULLis returned.
Example:
MText *
get_im_command_description (MSymbol language, MSymbol name, MSymbol command)
{
/* Return a description of the command COMMAND of the input method
specified by LANGUAGE and NAME. */
MPlist *cmd = minput_get_command (language, name, command);
MPlist *plist;
if (! cmds)
return NULL;
plist = mplist_value (cmds); /* (NAME DESCRIPTION STATUS KEY-SEQ ...) */
plist = mplist_next (plist); /* (DESCRIPTION STATUS KEY-SEQ ...) */
return (mplist_key (plist) == Mtext
? (MText *) mplist_value (plist)
: NULL);
}
as a note, this example is copied over exactly as it appears β variable names and all β because we keep every detail, fr fr. π
β¨ 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>.
and that's the whole page, bestie!! π you now know minput_get_command better than it knows itself. go forth and slay your key sequences. π
β¨
Version 1.8.4 β Mon Sep 25 2023 β bye babes, mwah ππ¦
π¦ 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