• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

eventListener firing twice on mac

Contributor ,
Nov 27, 2023 Nov 27, 2023

Copy link to clipboard

Copied

                    function mainListBoxEventListener(event){
                        var keyCode = event.keyName;
                        // Check if the key pressed is the Enter key (Key code: 13)
                        if (keyCode === "Enter") {
                            alert("entertest")
                        }else if(keyCode === "Down"){
                            alert("downtest")
                        }else if(keyCode === "Up"){
                            alert("uptest")
                        }else if (keyCode === "Escape") {
                            myPanel.close();
                            return false;
                        }
                        event.stopPropagation();
                    }

                    myPanel.grp.inputGroup.textFieldGroup.httpGroup.httpEditText.addEventListener("keydown", mainListBoxEventListener);


This is a snippet of my code (please ignore the commented section). It runs fine on Windows, with all the keys firing once. However, when I run the same code on mac, it always ends up firing twice, I can't seem to find the root source of the problem other than thinking it's a bug.

Hoping someone can help me here! TIA!

TOPICS
Scripting

Views

57

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Nov 27, 2023 Nov 27, 2023

I solved it and it was related to something else entirely.

Votes

Translate

Translate
Contributor ,
Nov 27, 2023 Nov 27, 2023

Copy link to clipboard

Copied

LATEST

I solved it and it was related to something else entirely.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines