minput_filter(3m17n)
πΈ NAME πΈ
minput_filter β and bestie, the actual description line in the source is literally empty. Just minput_filter - and nothing after the dash. No cap. We move on. π
This page is part of The m17n Library, so if you see 3m17n floating around, that's the vibe check passing. π¦
β¨ SYNOPSIS β¨
int minput_filter (MInputContext * ic, MSymbol key, void * arg)
π DESCRIPTION π
Okay so minput_filter() is the function that filters an input key. You hand it key, it filters that key according to the input context ic, and if the preedit text, the status, or the current candidate changed, it calls the callback functions that correspond to Minput_preedit_draw, Minput_status_draw, and Minput_candidates_draw respectively. Three possible callbacks, each tied to its own thing changing. Slay. π
Now the special-key tea, because this is the part everyone forgets:
- If you want the input method to commit the current preedit text (if there is any) and shift to the initial state, call this function with
Mnilaskey. Yes,Mnil. That's the move. π - Wanna tell the input method about a focus-out event? Call this function with
Minput_focus_outaskey. - Wanna tell it about a focus-in event? Call this function with
Minput_focus_inaskey. - Wanna tell it about a focus-move event β that's an input spot change within the same input context, iykyk β call this function with
Minput_focus_moveaskey.
Careful bestie: those four magic keys (Mnil,Minput_focus_out,Minput_focus_in,Minput_focus_move) aren't regular keystrokes, they're instructions. Pass them askeyand the function does the special thing. Don't treat them like normal input, fr fr. π«Ά
π RETURN VALUE π
1β the key got filtered out. In that case, the caller should discard the key. Throw it away, it's not yours anymore. π0β the key was not filtered out. In that case, the caller should handle the key β for instance, by calling the functionminput_lookup()with the same key. Your turn, main character. β¨
π 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, ily, go filter some keys π
This was Version 1.8.4, dated Mon Sep 25 2023 β mwah, signing off, bestie ππ¦π
π¦ 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