<?xml version="1.0"?>
<!--
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2026 Kent Stevens (timeplt)

********************************************
*
* Bindings for Winwing WINCTRL 32 RMP C
*
********************************************
-->
<PropertyList>
    <vendor-id>4098</vendor-id>
    <vendor-name>winctrl</vendor-name>
    <model-name>rmpc32</model-name>
    <model-id>bb85</model-id>
    <name>Winwing WINCTRL 32 RMP C</name>
    <debug-events type="bool">false</debug-events>
    <hid-debug-raw type="bool">false</hid-debug-raw>
    <nasal>
        <open>
            <![CDATA[
                logprint(LOG_DEBUG,"WINCTRL 32  RMP C Nasal (event) open");
                rmpc32 = input_helpers.winctrl.new("rmpc32",cmdarg(),device);
            ]]>
        </open>
        <close>
            <![CDATA[
                logprint(LOG_DEBUG,"WINCTRL 32 RMP C Nasal (event) close");
                rmpc32.close(cmdarg());
            ]]>
        </close>
    </nasal>
    <!-- HID BUTTONS  -->
    <event>
        <name>button-1</name>
        <desc>switchFreq</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>nasal</command>
            <script>rmp.transfer(1);</script>
        </binding>
    </event>
    <event>
        <name>button-2</name>
        <desc>VHF1</desc>
        <repeatable>true</repeatable>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>vhf1</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-3</name>
        <desc>VHF2</desc>
        <repeatable>true</repeatable>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>vhf2</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-4</name>
        <desc>VHF3</desc>
        <repeatable>true</repeatable>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>vhf3</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-5</name>
        <desc>LOAD</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/load</property>
           <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/load</property>
               <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-6</name>
        <desc>HF1</desc>
        <repeatable>true</repeatable>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>hf1</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-7</name>
        <desc>HF2</desc>
        <repeatable>true</repeatable>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>hf2</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-8</name>
        <desc>AM</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>property-toggle</command>
            <property>systems/radio/rmp[0]/am-active</property>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                    <or>
                        <equals>
                            <property>systems/radio/rmp[0]/sel_chan</property>
                            <value>hf1</value>
                        </equals>
                        <equals>
                            <property>systems/radio/rmp[0]/sel_chan</property>
                            <value>hf2</value>
                        </equals>
                    </or>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-9</name>
        <desc>NAV</desc>
        <repeatable>false</repeatable>
        <binding>
        <command>property-toggle</command>
        <property>systems/radio/rmp[0]/nav</property>
        <condition>
            <and>
                <greater-than-equals>
                    <property>systems/electrical/bus/dc-ess</property>
                    <value>25</value>
                </greater-than-equals>
                <property>controls/radio/rmp[0]/on</property>
            </and>
        </condition>
        </binding>
    </event>
    <event>
        <name>button-10</name>
        <desc>VOR</desc>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>vor</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                    <property>systems/radio/rmp[0]/nav</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-11</name>
        <desc>ls</desc>
        <repeatable>true</repeatable>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>ls</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                    <property>systems/radio/rmp[0]/nav</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-12</name>
        <desc>GLS</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/gls</property>
           <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/gls</property>
               <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-13</name>
        <desc>MLS</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/mls</property>
           <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/mls</property>
               <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-14</name>
        <desc>ADF</desc>
        <repeatable>true</repeatable>
        <binding>
            <command>property-assign</command>
            <property>systems/radio/rmp[0]/sel_chan</property>
            <value>adf</value>
            <condition>
                <and>
                    <greater-than-equals>
                        <property>systems/electrical/bus/dc-ess</property>
                        <value>25</value>
                    </greater-than-equals>
                    <property>controls/radio/rmp[0]/on</property>
                    <property>systems/radio/rmp[0]/nav</property>
                </and>
            </condition>
        </binding>
    </event>
    <event>
        <name>button-15</name>
        <desc>outer-left</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>nasal</command>
            <script>rmpc32.turnKnob(0,-1);</script>
        </binding>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/outer-left</property>
            <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/outer-left</property>
                <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-16</name>
        <desc>outer-right</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>nasal</command>
            <script>rmpc32.turnKnob(0,1);</script>
        </binding>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/outer-right</property>
            <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/outer-right</property>
                <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-17</name>
        <desc>inner-left</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>nasal</command>
            <script>rmpc32.turnKnob(1,-1);</script>
        </binding>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/inner-left</property>
            <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/inner-left</property>
                <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-18</name>
        <desc>inner-right</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>nasal</command>
            <script>rmpc32.turnKnob(1,1);</script>
        </binding>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/inner-right</property>
            <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/inner-right</property>
                <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-19</name>
        <desc>knob-press</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/knob-press</property>
           <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/knob-press</property>
               <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-20</name>
        <desc>RMP ON</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>property-assign</command>
            <property>/controls/radio/rmp[0]/on</property>
            <value>1</value>
        </binding>
        <binding>
            <command>property-assign</command>
            <property>/input/winctrl/rmpc32/buttons/powerOn</property>
           <value>1</value>
        </binding>
        <mod-up>
            <binding>
                <command>property-assign</command>
                <property>/input/winctrl/rmpc32/buttons/powerOn</property>
               <value>0</value>
            </binding>
        </mod-up>
    </event>
    <event>
        <name>button-21</name>
        <desc>RMP OFF</desc>
        <repeatable>false</repeatable>
        <binding>
            <command>property-assign</command>
            <property>/controls/radio/rmp[0]/on</property>
            <value>0</value>
        </binding>
    </event>
</PropertyList>
