Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
decode_modifiers(3)		 Arcan Lua API		   decode_modifiers(3)

NAME
       decode_modifiers	 -  Convert a modifier-bitmap to a textual representa-
       tion.

SYNOPSIS
       modtbl or modstr
       decode_modifiers( modval, separator )

DESCRIPTION
       The input table that is provided	as part	of the	_input	event  handler
       has  a  modifiers  field	that is	a bitmap of different modifier states.
       This bitmap can be converted to either an integer indexed table of text
       representations	of  each present modifier, or as a single concatenated
       string with the character in separator  added  between  the  individual
       modifiers.  If  the separator  argument is provided, and	is a non-empty
       string, then modstr  will be returned. Otherwise	modtbl	 will  be  re-
       turned.	The  different	possible text representations of the modifiers
       are: "lshift", "rshift",	"lalt",	 "ralt",  "lctrl",  "rctrl",  "lmeta",
       "rmeta",	"num", "caps", "mode"

NOTES
       1      If  the  separator is an empty string, the '_' character will be
	      used as separator	instead.

       2      There is also a modifier bit to indicate if the event was	a  re-
	      peat  (if	 the  input  platform supports that). This will	not be
	      added to the decoded output as it	would subtly break  a  lot  of
	      'naive' approaches to keybindings.

EXAMPLE
       function	decode_modifiers0()
	     print( table.concat(decode_modifiers( 0xffffff ), "0) );
	     print( decode_modifiers(0xffffff, "_") );
       end

system				  April	2022		   decode_modifiers(3)

NAME | SYNOPSIS | DESCRIPTION | NOTES | EXAMPLE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=decode_modifiers&sektion=3&manpath=FreeBSD+13.1-RELEASE+and+Ports>

home | help