This is an automated email from the ASF dual-hosted git repository. harbs pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push: new e91c02283f easier to read e91c02283f is described below commit e91c02283f8ec992154803a0428c0c31f465b13f Author: Harbs <ha...@in-tools.com> AuthorDate: Thu Jan 18 13:55:54 2024 +0200 easier to read --- .../org/apache/royale/utils/event/hasPlatformModifier.as | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/event/hasPlatformModifier.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/event/hasPlatformModifier.as index 11205518c7..51c20dce7a 100644 --- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/event/hasPlatformModifier.as +++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/event/hasPlatformModifier.as @@ -33,10 +33,16 @@ package org.apache.royale.utils.event return isMac ? (event as MouseEvent).metaKey : (event as MouseEvent).ctrlKey; } else if(event is KeyboardEvent){ return isMac ? (event as KeyboardEvent).metaKey : (event as KeyboardEvent).ctrlKey; - } else if(event.constructor.name == "MouseEvent" || event.constructor.name == "KeyboardEvent" || event.constructor.name == "PointerEvent"){ - return isMac ? event.metaKey : event.ctrlKey; + } else { + switch(event.constructor.name){ + case "MouseEvent": + case "KeyboardEvent": + case "PointerEvent": + return isMac ? event.metaKey : event.ctrlKey; + default: + return false; + } } - return false; } COMPILE::SWF