User Tools

Site Tools


macros:example:toggletriggermappings

This is an old revision of the document!


Example

Toggle Trigger Mappings

by: Sebastian Beutel
published: January 2018
description: Toggles trigger mappings on/off (without entering system mode).
remarks: Idea from facebook group: https://www.facebook.com/groups/Avolites/permalink/1163736800425219/

functions

Code

ToggleTriggerMappings.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Avolites.Menus.xsd">
<!-- the first two trigger mappings are predefined and fix, thus the first user mapping is ID 2 -->
 
  <macro id="Avolites.Macros.Triggers.Mapping.Toggle.1" name="Toggle Triggermapping 1">
    <description>Toggle Triggermapping 1.</description>
    <sequence>
      <step>Triggers.ToggleMappingEnable(2)</step>
    </sequence>
  </macro>
  <macro id="Avolites.Macros.Triggers.Mapping.Toggle.2" name="Toggle Triggermapping 2">
    <description>Toggle Triggermapping 2.</description>
    <sequence>
      <step>Triggers.ToggleMappingEnable(3)</step>
    </sequence>
  </macro>
  <macro id="Avolites.Macros.Triggers.Mapping.Toggle.3" name="Toggle Triggermapping 3">
    <description>Toggle Triggermapping 3.</description>
    <sequence>
      <step>Triggers.ToggleMappingEnable(4)</step>
    </sequence>
  </macro>
  <macro id="Avolites.Macros.Triggers.Mapping.Toggle.4" name="Toggle Triggermapping 4">
    <description>Toggle Triggermapping 4.</description>
    <sequence>
      <step>Triggers.ToggleMappingEnable(5)</step>
    </sequence>
  </macro>
  <macro id="Avolites.Macros.Triggers.Mapping.Toggle.5" name="Toggle Triggermapping 5">
    <description>Toggle Triggermapping 5.</description>
    <sequence>
      <step>Triggers.ToggleMappingEnable(6)</step>
    </sequence>
  </macro>
</avolites.macros>

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax

The macros use the function Triggers.ToggleMappingEnable to enable/disable trigger mappings. The first two mappings are predefined and cannot be altered, thus the user-defined mappings start with ID 2.

N.B. currently it is not possible to show whether a specific mapping is enabled using Active Binding as this requires a property, but there are no properties available for this purpose. (thanks to Gregory Haynes to explain this)

How to use it

You could leave a comment if you were logged in.
macros/example/toggletriggermappings.1522661022.txt.gz · Last modified: 2018/04/02 09:23 by icke_siegen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki