Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:bearlibterminal:reference:input [2014/12/04 22:35]
cfyzium
en:bearlibterminal:reference:input [2016/08/30 11:44] (current)
cfyzium
Line 91: Line 91:
     "​precise-mouse = false,"​     "​precise-mouse = false,"​
     "​mouse-cursor = true,"     "​mouse-cursor = true,"
-    "​filter=[];"​+    "​filter=[keyboard];"
 ); );
 </​sxh>​ </​sxh>​
Line 109: Line 109:
 === input.filter === === input.filter ===
 It is a list of events the application is interested in. All other will be silently processed by the library, thus [[#read]] will return only events from this list: It is a list of events the application is interested in. All other will be silently processed by the library, thus [[#read]] will return only events from this list:
-<​code>​input.filter = [escapespace, wasd, control+]</​code>​+<​code>​input.filter = [keyboardmouse+]</​code>​
 A name in the list may specify: A name in the list may specify:
 +  * an event group: '​keyboard',​ '​mouse',​ '​keypad',​ '​arrows'​.
   * a single event (name as in the table below, but without '​TK_'​ prefix; case-insensitive).   * a single event (name as in the table below, but without '​TK_'​ prefix; case-insensitive).
-  * an event group: '​arrow',​ '​keypad',​ '​keyboard',​ '​mouse',​ '​system'​ (TK_CLOSE + TK_RESIZED). 
   * a set of alphanumeric keys, e. g. '​wasd'​ or '​0123456789';​ obviously it must differ from event group names.   * a set of alphanumeric keys, e. g. '​wasd'​ or '​0123456789';​ obviously it must differ from event group names.
 +
 Mentioning the events enables reading them. If there is a '​+'​ (plus sign) added to the name, both keypresses and keyreleases will be read. Mentioning the events enables reading them. If there is a '​+'​ (plus sign) added to the name, both keypresses and keyreleases will be read.
  
-There is no input filtering if the list is empty (which is default). Therefore filtering is disabled by assigning an empty list to the //​input.filter//​ option.+Default filter is '​keyboard'​. To enable the mouse support, set the filter to '​keyboard,​ mouse'​. System events like TK_CLOSE and TK_RESIZED are always enabled. 
 + 
 +There is no input filtering if the list is empty. Therefore filtering is disabled by assigning ​'​none'​ or an empty list to the //​input.filter//​ option.
  
 ==== Event and state constants ==== ==== Event and state constants ====