<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to detect CTRL being pressed in a GeDialog]]></title><description><![CDATA[<p dir="auto">I am in a GeDialog and have a button that is by default disabled.<br />
I want to enable it as long as CTRL key is being pressed.</p>
]]></description><link>http://developers.maxon.net/forum/topic/14427/how-to-detect-ctrl-being-pressed-in-a-gedialog</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 23:19:02 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/14427.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Mar 2023 16:02:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to detect CTRL being pressed in a GeDialog on Tue, 14 Mar 2023 20:14:19 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/m_adam">@<bdi>m_adam</bdi></a><br />
I can confirm that the following does work with R20, R23 and 2023</p>
<pre><code>Int32 MyDialog::Message(const BaseContainer&amp; msg, BaseContainer&amp; result)
{
	BaseContainer keyChannels;
	if (GetInputState(BFM_INPUT_KEYBOARD, QCTRL, keyChannels))
	{
		Bool ctrlModifier = (keyChannels.GetInt32(BFM_INPUT_QUALIFIER) &amp; QCTRL) != 0;

</code></pre>
]]></description><link>http://developers.maxon.net/forum/post/70967</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70967</guid><dc:creator><![CDATA[C4DS]]></dc:creator><pubDate>Tue, 14 Mar 2023 20:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to detect CTRL being pressed in a GeDialog on Tue, 14 Mar 2023 09:54:28 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/c4ds">@<bdi>C4DS</bdi></a> this has indeed changed, I will check with the UI team to know the exact reason. To retrieve qualifier I find out that only GetInputState is working, so in the meantime you can do this like that and it work as expected</p>
<pre><code>    def Message(self, msg, result):
        res = c4d.BaseContainer()
        self.GetInputState(c4d.BFM_INPUT_KEYBOARD, c4d.QCTRL, res)

        if res[c4d.BFM_INPUT_QUALIFIER]:
            print(msg.GetId())
            isShiftPressed = bool(res[c4d.BFM_INPUT_QUALIFIER] &amp; c4d.QSHIFT)
            isCtrlPressed = bool(res[c4d.BFM_INPUT_QUALIFIER] &amp; c4d.QCTRL)
            isAltPressed = bool(res[c4d.BFM_INPUT_QUALIFIER] &amp; c4d.QALT)

            print(f"{isShiftPressed=}, {isCtrlPressed=}, {isAltPressed=}")
            print("----------------------------")

        return c4d.gui.GeDialog.Message(self, msg, result)
</code></pre>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/70959</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70959</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Tue, 14 Mar 2023 09:54:28 GMT</pubDate></item><item><title><![CDATA[Reply to How to detect CTRL being pressed in a GeDialog on Sat, 11 Mar 2023 14:49:33 GMT]]></title><description><![CDATA[<p dir="auto">The following works in R20</p>
<pre><code>Int32 MyDialog::Message(const BaseContainer&amp; msg, BaseContainer&amp; result)
{
	BaseContainer keyChannels;
	if (GetInputEvent(BFM_INPUT_KEYBOARD, keyChannels))
	{
		const Int32 qualifier = keyChannels.GetInt32(BFM_INPUT_QUALIFIER);
		ApplicationOutput("qualifier @", qualifier);
	}
</code></pre>
<p dir="auto">It shows a value '2' when I press CTRL key, '0' when I let go.</p>
<p dir="auto">But in R23 (and above), I don't get any output in console window.</p>
]]></description><link>http://developers.maxon.net/forum/post/70915</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/70915</guid><dc:creator><![CDATA[C4DS]]></dc:creator><pubDate>Sat, 11 Mar 2023 14:49:33 GMT</pubDate></item></channel></rss>