User Tools

Site Tools


commands:benable

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
commands:benable [2018/08/20 19:21]
jon
commands:benable [2019/04/18 23:33] (current)
Line 1: Line 1:
 +====== Command:​BENABLE (BE) ======
  
 +--> MS2000 or RM2000 syntax#
 +
 +^Shortcut ​ |BE   ​| ​
 +^Format ​ |BENABLE [X=Toggle] [Z=Enable_Byte] [F=Button_Function]|
 +^Units ​   |none|
 +^Remembered |Using SS Z |
 +
 +<--
 +
 +--> Tiger syntax# ​
 +
 +^Shortcut ​ |BE   ​| ​
 +^Format ​ |[Addr#​]BENABLE [X=Toggle] [Y?] [Z=Enable_Byte] [F=Button_Function] |
 +^Units ​   |none|
 +^Type    |Card-Addressed ​ |
 +^Remembered |Using [addr#]SS Z |
 +
 +<--
 +
 +Enables or disables button functions for the specified card and specified buttons, either all/none (X, or Toggle) or with finer granularity (Z, or Enable_byte). ​ Toggle=0 disables all buttons and pulses; i.e. BE X=0 is equivalent to BE Z=0.  Toggle=1 enables all buttons and pulses (default settings); i.e. ''​BE X=1''​ is equivalent to ''​BE Z=15''​. ​ Querying X returns the same as querying Z.  Specific buttons can be enabled/​disabled by explicitly setting the ''​Enable_Byte''​. The bits are set to one ''​1''​ when enabled or zero ''​0''​ when disabled, and are defined as follows:
 +
 +**Z** parameter ''​Enable_Byte''​ is bit-mapped number that determines which buttons are enabled or disabled as tabulated below. ​ Bit5 is a special case; it changes the behavior of the physical button to zero the Z axis only and has been removed from Tiger code after v3.20.
 +
 +^Bit#​ ^Button ^
 +|0 |“Zero” Button ​     |
 +|1 |“Home” Button ​     |
 +|2 |“@” Button ​        |
 +|3 |Joystick Button ​   |
 +|4 |Reserved ​          |
 +|5 |Zero Z Only (removed from Tiger after v3.20) |
 +|6 |Reserved ​          |
 +|7 |Reserved ​          |
 +
 +
 +**F** parameter ''​Button_Function''​ is a positive integer code for the button function that will be executed. ​ See [[commands:​bcustom|documentation of BCUSTOM]] for a list of available button functions. ​ This allows a button press to be simulated using a serial command. ​ This is available from Tiger v3.19 onward and in middle of Whizkid v9.2l.
 +
 +
 +--> Tiger Example#
 +
 +To make Axis on Card#1 ignore the zero and home button, and only respond to Joystick and @ buttons. ​
 +Bit 3 and Bit 2 set to '​1'​ , Bit 1 and Bit 0 set to '​0'​. Binary '​1100'​ is Decimal '​12'​
 +
 +<asi> $ 1BE Z=12
 +:​A</​asi>​
 +
 +
 +<--
 +
 +--> MS2000 Example#
 +
 +To make all the axis on controller ignore the zero and home button, and only respond to Joystick and @ buttons. ​
 +Bit 3 and Bit 2 set to '​1'​ , Bit 1 and Bit 0 set to '​0'​. Binary '​1100'​ is Decimal '​12'​
 +
 +<asi> $ BE Z=12
 +:​A</​asi>​
 +
 +
 +<--
 +
 +
 +--> Additional Feature in Tiger Version 3.14+ #
 +
 +Addressing the COMM card specifically (or omitting the address on the command) results in a different behavior. Disabling a button on the COMM card will result in disabling that functionality for all cards in the rack. This disabling happens at the COMM card so the other cards in the rack never receive notification of a change in the button'​s state. In this way, individual cards may be set to the desired functionality and a layer of control over all cards may be applied without affecting the settings on individual cards. \\ \\
 +
 +The ''​0BE Y?''​ query command provides a report of past button states. Every time one of the inputs is activated, the COMM card notes the activation by setting a bit in a status byte. That bit will remain set until the status byte is queried again on the COMM card with ''​0BE Y?''​. The result of the query will return the current status byte to the host, then clear the status byte (set all bits representing input sources to 0), thereby preparing the status byte for further button press detection. The format of the bits in the returned status byte is the same as the table above. A one ''​1''​ on the specified bit represents the input has been activated since the last query.
 +
 +Starting with v3.21, a button that is held down during a serial query of button state will be reported as activated every query up through the one immediately following release. ​ This can be used by high-level software to time button presses, e.g. if querying happens every second and the button is held down for 1.001 seconds then it will be reported as being held down twice. ​ If the button is held down for 0.1 seconds then most of the time it will only be reported once, unless the query happens to occur during that 0.1 seconds in which case it will be reported twice.
 +
 +<--
 +
 +{{tag>​commands tiger ms2000}}
commands/benable.txt · Last modified: 2019/04/18 23:33 (external edit)