GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
decode_modifiers(3) Arcan Lua API decode_modifiers(3)

decode_modifiers - Convert a modifier-bitmap to a textual representation.

modtbl or modstr
decode_modifiers( modval, separator )

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 returned. The different possible text representations of the modifiers are: "lshift", "rshift", "lalt", "ralt", "lctrl", "rctrl", "lmeta", "rmeta", "num", "caps", "mode"

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.

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

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.