"keydown" event in plugin crashes WeBuilder

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
User avatar
pmk65
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

"keydown" event in plugin crashes WeBuilder

Post by pmk65 »

When I try using the "keydown" event, the editor crashes (I have send an error report)

Example code:

Code: Select all

function OnKeypress(key) {
    Script.Message("keypress: " + key);
}
function OnKeydown(key) {
    Script.Message("keydown: " + key);
}

Script.ConnectSignal("keypress", "OnKeypress");
Script.ConnectSignal("keydown", "OnKeydown"); // This crashes WeBuilder
Program used: WeBuilder 2016 v14.0.0.184
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: "keydown" event in plugin crashes WeBuilder

Post by Aivars »

This will be fixed in the next update but there are actually 2 parameters:

Code: Select all

function OnKeydown(key, shift)
You can add shift parameter in the current version, too, and that will fix the crash, but currently "shift" will be undefined. Only the key parameter will work.
Blumentals Software Programmer
User avatar
pmk65
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: "keydown" event in plugin crashes WeBuilder

Post by pmk65 »

Thanks.
Unfortunatly it's the 2nd parameter I wanted (I want to test if Shift/Ctrl/Alt key is pressed)
So I'll just wait for the next update. :)
There are 10 types of people in the world: Those who understand binary and those who don't.
Post Reply