Suggestion Issue: Enable Right/Middle Mouse Buttons for Flash/HTML5


Pages: 1

rob1221

  • Master Stencyler
  • *
November 30, 2019, 11:52:38 am
The event listeners for the right and middle mouse buttons are currently locked to desktop only, but in my testing they work fine on Flash and HTML5 too as long as the following code is used first:
Code: [Select]
Engine.stage.showDefaultContextMenu = false;


Issue updated by Justin - December 07, 2019, 01:52:59 am
  • Tags added: 4.1.0


Justin

  • Master Stencyler
  • *
October 01, 2020, 10:43:00 pm
I tried that out, and it does work nicely on all platforms. But since Stencyl doesn't currently have built-in support (via blocks) for middle and right mouse buttons, it would be a little out of place to include.

Perhaps including it as a block in the extra mouse buttons extension would be better for now.

Code: [Select]
<block tag="toggleMouseContextMenu" spec="%0 mouse-click context menu" code="Engine.stage.showDefaultContextMenu = #0;" type="action" color="green" returns="void">
<fields>
<dropdown order="0">
<choices>
<c text="enable" code="true" />
<c text="disable" code="false" />
</choices>
</dropdown>
</fields>
</block>
« Last Edit: October 01, 2020, 10:50:28 pm by Justin »


rob1221

  • Master Stencyler
  • *
October 03, 2020, 11:02:24 am
I had updated the extension to turn off the context menu on right click but I never bothered to publish the update due to the engine edit required.


Justin

  • Master Stencyler
  • *
October 03, 2020, 09:21:32 pm
Engine update? What's needed beside the code you mentioned? Everything worked fine for me when I added the above block to your extension and called that before clicking.


rob1221

  • Master Stencyler
  • *
October 04, 2020, 05:23:06 am
I'm referring to this in Input:
Code: [Select]
#if desktop
Engine.stage.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, onRightMouseDown, false, 2);
Engine.stage.addEventListener(MouseEvent.RIGHT_MOUSE_UP, onRightMouseUp, false, 2);
Engine.stage.addEventListener(MouseEvent.MIDDLE_MOUSE_DOWN, onMiddleMouseDown, false, 2);
Engine.stage.addEventListener(MouseEvent.MIDDLE_MOUSE_UP, onMiddleMouseUp, false, 2);
#end
« Last Edit: October 04, 2020, 05:24:02 am by rob1221 »


Justin

  • Master Stencyler
  • *
October 04, 2020, 09:14:07 am
Oh, yeah, I changed that on my side as well and somehow managed to completely forget about it. Sorry about that. I'll make that change soon.


Justin

  • Master Stencyler
  • *
October 13, 2020, 07:10:39 pm
Changed in private build 10621. Will be available in public release 4.1.0.
  • Issue Assigned from (none) to Justin
  • Status changed from New to Resolved


Pages: 1

Details

  • Reported
    November 30, 2019, 11:52:38 am
  • Updated
    October 13, 2020, 07:10:39 pm

  • View Status
    Public
  • Type
    Suggestion
  • Status
    Resolved
  • Priority
    Normal
  • Version
    (none)
  • Fixed in
    (none)
  • Assigned to
    Justin
  • Category
    Engine

Tags