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 representation.

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 char-
     acter  in separator  added between the individual modifiers. If the separa-
     tor  argument is provided, and is a non-empty string, then modstr	will  be
     returned.	Otherwise  modtbl  will be returned. 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  repeat
	    (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				   August 2026		     decode_modifiers(3)

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

home | help