<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">digitizer_set_position</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.5</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.5</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>The "in range" indicator is required to be on for the change in coordinates to be taken. It can then be turned off again to signal the end of the digitizer interaction, but it is not strictly required.</p><p>You can also modify the digitizer state directly, if you need to change multiple fields in a single report:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">digitizer_state.in_range </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">digitizer_flush</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span></code></pre></div><p><code>digitizer_state</code> is a struct of type <code>digitizer_t</code>.</p><h2id="api"tabindex="-1">API <aclass="header-anchor"href="#api"aria-label="Permalink to "API {#api}""></a></h2><h3id="api-digitizer-t"tabindex="-1"><code>struct digitizer_t</code><aclass="header-anchor"href="#api-digitizer-t"aria-label="Permalink to "`struct digitizer_t` {#api-digitizer-t}""></a></h3><p>Contains the state of the digitizer.</p><h4id="api-digitizer-t-members"tabindex="-1">Members <aclass="header-anchor"href="#api-digitizer-t-members"aria-label="Permalink to "Members {#api-digitizer-t-members}""></a></h4><ul><li><code>bool in_range</code><br> Indicates to the host that the contact is within range (ie. close to or in contact with the digitizer surface).</li><li><code>bool tip</code><br> The state of the tip switch.</li><li><code>bool barrel</code><br> The state of the barrel switch.</li><li><code>float x</code><br> The X coordinate of the digitizer contact.</li><li><code>float y</code><br> The Y coordinate of the digitizer contact.</li><li><code>bool dirty</code><br> Whether the current state needs to be sent to the host.</li></ul><hr><h3id="api-digitizer-flush"tabindex="-1"><code>void digitizer_flush(void)</code><aclass="header-anchor"href="#api-digitizer-flush"aria-label="Permalink to "`void digitizer_flush(void)` {#api-digitizer-flush}""></a></h3><p>Send the digitizer report to the host if it is marked as dirty.</p><hr><h3id="api-digitizer-in-range-on"tabindex="-1"><code>void digitizer_in_range_on(void)</code><aclass="header-anchor"href="#api-digitizer-in-range-on"aria-label="Permalink to "`void digitizer_in_range_on(void)` {#api-digitizer-in-range-on}""></a></h3><p>Assert the "in range" indicator, and flush the report.</p><hr><h3id="api-digitizer-in-range-off"tabindex="-1"><code>void digitizer_in_range_off(void)</code><aclass="header-anchor"href="#api-digitizer-in-range-off"aria-label="Permalink to "`void digitizer_in_range_off(void)` {#api-digitizer-in-range-off}""></a></h3><p>Deassert the "in range" indicator, and flush the report.</p><hr><h3id="api-digitizer-tip-switch-on"tabindex="-1"><code>void digitizer_tip_switch_on(void)</code><aclass="header-anchor"href="#api-digitizer-tip-switch-on"aria-label="Permalink to "`void digitizer_tip_switch_on(void)` {#api-digitizer-tip-switch-on}""></a></h3><p>Assert the tip switch, and flush the report.</p><hr><h3id="api-digitizer-tip-switch-off"tabindex="-1"><code>void digitizer_tip_switch_off(void)</code><aclass="header-anchor"href="#api-digitizer-tip-switch-off"aria-label="Permalink to "`void digitizer_tip_switch_off(void)` {#api-digitizer-tip-switch-off}""></a></h3><p>Deassert the tip switch, and flush the report.</p><hr><h3id="api-digitizer-barrel-switch-on"tabindex="-1"><code>void digitizer_barrel_switch_on(void)</code><aclass="header-anchor"href="#api-digitizer-barrel-switch-on"aria-label="Permalink to "`void digitizer_barrel_switch_on(void)` {#api-digitizer-barrel-switch-on}""></a></h3><p>Assert the barrel switch, and flush the report.</p><hr><h3id="api-digitizer-barrel-switch-off"tabindex="-1"><code>void digitizer_barrel_switch_off(void)</code><aclass="header-anchor"href="#api-digitizer-barrel-switch-off"aria-label="Permalink to "`void digitizer_barrel_switch_off(void)` {#api-digitizer-barrel-switch-off}""></a></h3><p>Deassert the barrel switch, and flush the report.</p><hr><h3id="api-digitizer-set-position"tabindex="-1"><code>void digitizer_set_position(float x, float y)</code><aclass="header-anchor"href="#api-digitizer-set-position"aria-label="Permalink to "`void digitizer_set_position(float x, float y)` {#api-digitizer-set-position}""></a></h3><p>Set the absolut