<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fusion-API Mouse Handling in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13318951#M247</link>
    <description>&lt;P&gt;The following description should explain why this happens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;Casting rules&lt;/DIV&gt;&lt;P&gt;Unscoped enum constants can be implicitly converted to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;, but an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is never implicitly convertible to an enum value. The following example shows what happens if you try to assign&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hand&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;a value that isn't a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Suit:&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;C++&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;int&lt;/SPAN&gt; account_num = &lt;SPAN class=""&gt;135692&lt;/SPAN&gt;;
Suit hand;
hand = account_num; &lt;SPAN class=""&gt;// error C2440: '=' : cannot convert from 'int' to 'Suit'&lt;/SPAN&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;A cast is required to convert an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to a scoped or unscoped enumerator. However, you can promote an unscoped enumerator to an integer value without a cast.&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;C++&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;int&lt;/SPAN&gt; account_num = Hearts; &lt;SPAN class=""&gt;//OK if Hearts is in an unscoped enum&lt;/SPAN&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Using implicit conversions in this way can lead to unintended side-effects. To help eliminate programming errors associated with unscoped enums, scoped enum values are strongly typed. Scoped enumerators must be qualified by the enum type name (identifier) and can't be implicitly converted, as shown in the following example:&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;C++&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;namespace&lt;/SPAN&gt; ScopedEnumConversions
{
    &lt;SPAN class=""&gt;enum&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;class&lt;/SPAN&gt; &lt;SPAN class=""&gt;Suit&lt;/SPAN&gt; {&lt;/SPAN&gt; Diamonds, Hearts, Clubs, Spades };

    &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;void&lt;/SPAN&gt; &lt;SPAN class=""&gt;AttemptConversions&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt;
    &lt;/SPAN&gt;{
        Suit hand;
        hand = Clubs; &lt;SPAN class=""&gt;// error C2065: 'Clubs' : undeclared identifier&lt;/SPAN&gt;
        hand = Suit::Clubs; &lt;SPAN class=""&gt;//Correct.&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;int&lt;/SPAN&gt; account_num = &lt;SPAN class=""&gt;135692&lt;/SPAN&gt;;
        hand = account_num; &lt;SPAN class=""&gt;// error C2440: '=' : cannot convert from 'int' to 'Suit'&lt;/SPAN&gt;
        hand = &lt;SPAN class=""&gt;static_cast&lt;/SPAN&gt;&amp;lt;Suit&amp;gt;(account_num); &lt;SPAN class=""&gt;// OK, but probably a bug!!!&lt;/SPAN&gt;

        account_num = Suit::Hearts; &lt;SPAN class=""&gt;// error C2440: '=' : cannot convert from 'Suit' to 'int'&lt;/SPAN&gt;
        account_num = &lt;SPAN class=""&gt;static_cast&lt;/SPAN&gt;&amp;lt;&lt;SPAN class=""&gt;int&lt;/SPAN&gt;&amp;gt;(Suit::Hearts); &lt;SPAN class=""&gt;// OK&lt;/SPAN&gt;
    }
}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Notice that the line&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hand = account_num;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;still causes the error that occurs with unscoped enums, as shown earlier. It's allowed with an explicit cast. However, with scoped enums, the attempted conversion in the next statement,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;account_num = Suit::Hearts;, is no longer allowed without an explicit cast.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The complete article can be found &lt;A href="https://learn.microsoft.com/en-us/cpp/cpp/enumerations-cpp?view=msvc-170" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2025 07:44:14 GMT</pubDate>
    <dc:creator>manfred_weinert</dc:creator>
    <dc:date>2025-02-14T07:44:14Z</dc:date>
    <item>
      <title>Fusion-API Mouse Handling</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13314468#M243</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I have been working with the Fusion API recently.&lt;BR /&gt;I noticed the following in connection with the development of "MouseEventHandler".&lt;BR /&gt;The notify member function of the "MouseEventHandler" class receives the address of the "MouseEventArgs" object from the caller.&lt;BR /&gt;"void OnMousexxxxxHandler::notify(const Ptr&amp;lt;MouseEventArgs&amp;gt;&amp;amp; eventArgs)"&lt;BR /&gt;The "MouseEventArgs" object also includes the "button" property. This is described in the API as follows: "Retrieves which mouse button(s) are pressed.&lt;BR /&gt;The returned value is bitwise and can indicate that more than one button is pressed."&lt;BR /&gt;If you follow the link under button you will find out that button is of type "enum MouseButtons{...}", which is defined as follows:&lt;BR /&gt;/// Mouse button values.&lt;BR /&gt;enum MouseButtons&lt;BR /&gt;{&lt;BR /&gt;/// None&lt;BR /&gt;NoMouseButton = 0x0,&lt;BR /&gt;/// Left&lt;BR /&gt;LeftMouseButton = 0x1,&lt;BR /&gt;/// Right&lt;BR /&gt;RightMouseButton = 0x2,&lt;BR /&gt;/// Middle&lt;BR /&gt;MiddleMouseButton = 0x4&lt;BR /&gt;};&lt;BR /&gt;But that doesn't match the description of "button", because it explicitly states that all key combinations can occur.&lt;BR /&gt;Accordingly, the definition for MuoseButtons should look like this:&lt;BR /&gt;/// Mouse button values.&lt;BR /&gt;enum MouseButtons&lt;BR /&gt;{&lt;BR /&gt;/// None&lt;BR /&gt;NoMouseButton = 0x0,&lt;BR /&gt;/// Left&lt;BR /&gt;LeftMouseButton = 0x1,&lt;BR /&gt;/// Right&lt;BR /&gt;RightMouseButton = 0x2,&lt;BR /&gt;/// LeftRight&lt;BR /&gt;LeftRightMouseButton = 0x3&lt;BR /&gt;/// Middle&lt;BR /&gt;MiddleMouseButton = 0x4&lt;BR /&gt;/// LeftRight&lt;BR /&gt;LeftMiddleMouseButton = 0x5&lt;BR /&gt;/// LeftRight&lt;BR /&gt;MiddleRightMouseButton = 0x6&lt;BR /&gt;/// LeftRight&lt;BR /&gt;LeftMiddleRightMouseButton = 0x7&lt;BR /&gt;};&lt;BR /&gt;It has also been noticed that when reading the button value for all types of mouse events (drag, down, up, click, move) either no mouse button is returned&lt;BR /&gt;or only the left mouse button is returned as pressed.&lt;BR /&gt;This could of course be because the basic software processes the right mouse button or middle mouse button pressed beforehand and no longer passes the information&lt;BR /&gt;on to the subsequently installed mouse event.&lt;BR /&gt;I would like to know if anyone can give me more detailed information on how this works in the context of ADDÍN development.&lt;BR /&gt;Is there, for example, an API function with which all mouse activities are forwarded to a corresponding ADDIN?&lt;BR /&gt;Can the first recipients of the mouse events be switched off under certain circumstances so that the ADDIN becomes the first recipient???&lt;/P&gt;&lt;P&gt;Thank you in advance for your advice.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 11:20:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13314468#M243</guid>
      <dc:creator>manfred_weinert</dc:creator>
      <dc:date>2025-02-12T11:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Fusion-API Mouse Handling</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13315550#M244</link>
      <description>&lt;P&gt;I haven't done much with the mouse events and don't have any first-hand information about their behavior, but I can answer your first question about the enums. Bitwise enum values can be combined to indicate more than one value. Notice how the values skip 3. We can see why if we look at the binary equivalent of those numbers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0 - 000&lt;/P&gt;&lt;P&gt;1 -&amp;nbsp; 001&lt;/P&gt;&lt;P&gt;2 - 010&lt;/P&gt;&lt;P&gt;4 - 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each value is a separate bit in the binary representation. If I get 101, it is a combination of 1 and 4. A value of 7 is all the combined bits, indicating that all three buttons were pressed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how I can check it in the code to see when both the left and right are pressed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if pressedButtons &amp;amp; (adsk.core.MouseButtons.LeftMouseButton | adsk.core.MouseButtons.RightMouseButton):
    app.log('left and right mouse buttons (and maybe the middle) are pressed.')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, it checks if only the left and right are pressed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if pressedButtons == (adsk.core.MouseButtons.LeftMouseButton | adsk.core.MouseButtons.RightMouseButton):
   app.log('Only the left and right are pressed')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Or here's a simpler way to check if only the left and right are pressed, but it's not as self-documenting:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if pressedButtons == 3:
   app.log('Only the left and right are pressed')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a good article on using bitwise operators.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.geeksforgeeks.org/python-bitwise-operators/" target="_blank" rel="noopener"&gt;https://www.geeksforgeeks.org/python-bitwise-operators/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 19:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13315550#M244</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2025-02-12T19:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fusion-API Mouse Handling</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13316953#M245</link>
      <description>&lt;P&gt;Brian, thank you for your quick response.&lt;/P&gt;&lt;P&gt;First of all, I should probably mention that I use C++ as my programming language.&lt;/P&gt;&lt;P&gt;Your contribution helped me a lot.&lt;/P&gt;&lt;P&gt;In general, I already know how data is processed bit by bit.&lt;/P&gt;&lt;P&gt;However, I was not aware that it is possible to assign other values ​​to an enum variable that are not specified in the type definition.&lt;/P&gt;&lt;P&gt;executes the following line of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;Core/CoreAll.h&amp;gt;
sing namespace adsk::core;
int i_mbs;
MouseButtons mbs_mbs;
i_mbs = LeftMouseButton | RightMouseButton;
mbs_mbs = i_mbs; // compiler Error 2440
mbs_mbs = LeftMouseButton | RightMouseButton;// compiler Error 2440
mbs_mbs = static_cast&amp;lt;MouseButtons&amp;gt; (i_mbs);//OK
mbs_mbs = static_cast&amp;lt;MouseButtons&amp;gt; (LeftMouseButton | RightMouseButton);//OK
mbs_mbs = static_cast&amp;lt;MouseButtons&amp;gt; (8);//OK&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For line 6 and 7 you will get a compilation error 2440.&lt;/P&gt;&lt;P&gt;line 8 to 10 will run through compilation without errors.&lt;/P&gt;&lt;P&gt;But line 10 shows up, that this way can cause programm errors, because you can set up any integer value to the variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the other problem with the mouse button states not being passed on to the add-in is probably the bigger one.&lt;/P&gt;&lt;P&gt;I have to get into the habit of separating problems from each other because I can't mark the post as solved yet.&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 12:19:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13316953#M245</guid>
      <dc:creator>manfred_weinert</dc:creator>
      <dc:date>2025-02-13T12:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fusion-API Mouse Handling</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13317538#M246</link>
      <description>&lt;P&gt;Here's an article for C++ that explains bitwise operators.&lt;BR /&gt;&lt;A href="https://www.geeksforgeeks.org/cpp-bitwise-operators/" target="_blank"&gt;https://www.geeksforgeeks.org/cpp-bitwise-operators/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the error you're seeing is probably because of the variable type of mbs_mbs. enum values are an integer and not a type.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 16:04:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13317538#M246</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2025-02-13T16:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Fusion-API Mouse Handling</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13318951#M247</link>
      <description>&lt;P&gt;The following description should explain why this happens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;Casting rules&lt;/DIV&gt;&lt;P&gt;Unscoped enum constants can be implicitly converted to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;, but an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is never implicitly convertible to an enum value. The following example shows what happens if you try to assign&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hand&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;a value that isn't a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Suit:&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;C++&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;int&lt;/SPAN&gt; account_num = &lt;SPAN class=""&gt;135692&lt;/SPAN&gt;;
Suit hand;
hand = account_num; &lt;SPAN class=""&gt;// error C2440: '=' : cannot convert from 'int' to 'Suit'&lt;/SPAN&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;A cast is required to convert an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to a scoped or unscoped enumerator. However, you can promote an unscoped enumerator to an integer value without a cast.&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;C++&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;int&lt;/SPAN&gt; account_num = Hearts; &lt;SPAN class=""&gt;//OK if Hearts is in an unscoped enum&lt;/SPAN&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Using implicit conversions in this way can lead to unintended side-effects. To help eliminate programming errors associated with unscoped enums, scoped enum values are strongly typed. Scoped enumerators must be qualified by the enum type name (identifier) and can't be implicitly converted, as shown in the following example:&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;C++&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;namespace&lt;/SPAN&gt; ScopedEnumConversions
{
    &lt;SPAN class=""&gt;enum&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;class&lt;/SPAN&gt; &lt;SPAN class=""&gt;Suit&lt;/SPAN&gt; {&lt;/SPAN&gt; Diamonds, Hearts, Clubs, Spades };

    &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;void&lt;/SPAN&gt; &lt;SPAN class=""&gt;AttemptConversions&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt;
    &lt;/SPAN&gt;{
        Suit hand;
        hand = Clubs; &lt;SPAN class=""&gt;// error C2065: 'Clubs' : undeclared identifier&lt;/SPAN&gt;
        hand = Suit::Clubs; &lt;SPAN class=""&gt;//Correct.&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;int&lt;/SPAN&gt; account_num = &lt;SPAN class=""&gt;135692&lt;/SPAN&gt;;
        hand = account_num; &lt;SPAN class=""&gt;// error C2440: '=' : cannot convert from 'int' to 'Suit'&lt;/SPAN&gt;
        hand = &lt;SPAN class=""&gt;static_cast&lt;/SPAN&gt;&amp;lt;Suit&amp;gt;(account_num); &lt;SPAN class=""&gt;// OK, but probably a bug!!!&lt;/SPAN&gt;

        account_num = Suit::Hearts; &lt;SPAN class=""&gt;// error C2440: '=' : cannot convert from 'Suit' to 'int'&lt;/SPAN&gt;
        account_num = &lt;SPAN class=""&gt;static_cast&lt;/SPAN&gt;&amp;lt;&lt;SPAN class=""&gt;int&lt;/SPAN&gt;&amp;gt;(Suit::Hearts); &lt;SPAN class=""&gt;// OK&lt;/SPAN&gt;
    }
}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Notice that the line&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hand = account_num;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;still causes the error that occurs with unscoped enums, as shown earlier. It's allowed with an explicit cast. However, with scoped enums, the attempted conversion in the next statement,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;account_num = Suit::Hearts;, is no longer allowed without an explicit cast.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The complete article can be found &lt;A href="https://learn.microsoft.com/en-us/cpp/cpp/enumerations-cpp?view=msvc-170" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 07:44:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-api-mouse-handling/m-p/13318951#M247</guid>
      <dc:creator>manfred_weinert</dc:creator>
      <dc:date>2025-02-14T07:44:14Z</dc:date>
    </item>
  </channel>
</rss>

