CTRL and down remote sensing

Hello

I want to put a public var to true when you press ctrl shift and set to false, then when they are not pressed.  This is to link with some features of datagrid that respond differntly when Ctrl or shift are down.

onKeyBoardDown() is sussessfully followed when the keys are down, but onKeyboardUp is not when they are released. Why is this?  Thank you!

stage.addEventListener (KeyboardEvent.KEY_UP, onKeyBoardUp);

stage.addEventListener (KeyboardEvent.KEY_DOWN, onKeyBoardDown);

private void onKeyBoardDown(event:KeyboardEvent):void

{

If (event.ctrlKey) //if control button is pressed

{

trace ("CTRL on ');

}

Else if (event.shiftKey)

{

trace ("SHIFT on ');

}

on the other

{

trace ('NONE!');

}

}

private void onKeyBoardUp(event:KeyboardEvent):void

{

If (event.ctrlKey) //if control button is released

{

trace ('CTRL off');

}

Else if (event.shiftKey)

{

trace ("off SHIFT");

}

}

To answer why your original code does not work, you use KeyboardEvent to indicate the current state of the 2 keys in a way ' if/else '.

For example, when you release the CTRL key, event.ctrlKey will always be false (because it is more of course). Same thing with the release of TRAVEL if you release that will always make it false.

Use the keycode as moccamaximum mentioned, but you have to detect combinations do not limit it to the "if/else".

for example:

var ctrlIsDown:Boolean = false;

var shiftIsDown:Boolean = false;

function onKeyBoardDown(e:KeyboardEvent):void

{

If (e.keyCode is 17)

{

trace ("CTRL on ');

the value of state var for CTRL

ctrlIsDown = true;

}

do not use on the other, separate logic

If (e.keyCode is 16)

{

trace ("SHIFT on ');

set var to SHIFT State

shiftIsDown = true;

}

}

function onKeyBoardUp(e:KeyboardEvent):void

{

If (e.keyCode is 17)

{

trace ('CTRL off');

the value of state var for CTRL

ctrlIsDown = false;

}

do not use on the other, separate logic

If (e.keyCode is 16)

{

trace ("off SHIFT");

set var to SHIFT State

shiftIsDown = false;

}

make a function to check the key States

If necessary here and making adjustments

based on shift or control separately

}

keyCode has limits, beware. Alternative keyboards are known to change the values for keycode of unexpected results. Modify if needed. Consider charCode and keyCode has other limits:

http://help.Adobe.com/en_US/Flex/using/WS2db454920e96a9e51e63e3d11c0bf64a29-7fdb.html#WS2d b454920e96a9e51e63e3d11c0bf64a29-7fed

Tags: Adobe Animate

Similar Questions

  • Hai iam Amaladas from Chennai (India) iam Remote Sensing and GIS researcher here most people using the Google Earth application and five members using Iphone, we need a Google Earth app (India)

    Hai iam Amaladas from Chennai (India) iam Remote Sensing and GIS researcher here most people using the Google Earth application and five members using Iphone, we need an app (India) of Google Earth?

    https://www.Google.com/search?q=Google+Earth+app+India&ie=UTF-8&OE=UTF-8

  • wiring of remote sensing and shielding to the Earth, 9237 requirements

    Hi, I have a set of scales (full-bridge) connected to a 9237 (in a 9172 chassis), and I have two questions regarding the wiring:

    (1) requires remote sensing that you have two additional sons detach from the cell, to the place where the wires attach to the wheatstone bridge?

    (2) where I should connect the shield of the load cell 50/60 Hz noise? to the Ex-terminal (as well as the Ex-fil)?

    Thank you

    Claire.

    Hi Claire,

    (1) Yes.  Drivers of remote sense must be connected to the points where the voltage wires connect to the bridge circuit.

    (2) Yes.  The shielding must be connected to the reference of the unit, who is the EX - for the 9237.

    See NI 9237 Instructions and specifications manual and this DevZone for more information.

  • How can I get my Windows xp computer to stop moving in waves up and down the screen?

    Today I had to uninstall Windows XP Home Edition and resinstall it.  I also installed SP 2 and SP 3.  I'm slowly getting updates from Microsoft Update, but now I have problems with my computer when I'm online and up and down the screen.  Only, it moves slowly and in the waves.  What can I do?

    Do you mean that you have chosen to uninstall Windows XP and reinstall?

    What was the problem that forced you to do?

    Anywho, if you reinstalled XP did you get the latest video drivers for your system on site WWW of manufacturer video system?   What audio drivers?  Your sound is OK works?

    Video drivers that might be on a XP CD installation will probably not be the ones you need and it is never a good choice to use the updates of hardware which are available from the Microsoft updates - driver Microsoft made generally bad choice in this area.

    If you are not sure what you have or what video drivers you need, maybe we can help you find them if we only know basic information about your system (another shortcoming of Microsoft MS Answers).

    If you do this, we have more on your system:

    Click Start, run and enter in the box:

    Msinfo32

    Click OK, and when the system info summary appears, click on edit, select all (Ctrl-A), copy (Ctrl-C) and paste (Ctrl-V) the information back here in your next reply.

    For information about video drivers, expand components, click view, click on edit, select all, copy and then paste the information here.

    For information about the audio drivers, expand components, click Sound Device, click on edit, select all, copy and then paste the information here.

    There will be some personal information (such as the user name and the name of the system), and anything that turns information private for you, simply delete the pasted information.

    This will minimize back Q & A and eliminate guesswork.

  • Help! Why is my screen sideways instead of up and down?

    child of my friend was on my computer perform buttons and when I got to him the screen is on the side instead of up and down. I looked in all the menus and can not find a way to return to normal. can someone please?

    Try pressing Ctrl + Alt + arrow keys pointing UPWARDS.

    That should fix it.

    See you soon. Mick Murphy - Microsoft partner

  • How am I able to set the keyboard shortcut for the displacement of the layers vertically ctrl + [and ctrl +]? (CS6)

    How am I able to set the keyboard shortcut for the displacement of the layers vertically ctrl + [and ctrl +]?

    You shouldn't have to they are the default ones. You can change these keyboard shortcuts Application Menus layers organize section. Down is backwards and upwards towards the front

  • need upper and down arrows for Mac Mail as IPhone and iPad

    When Apple will add arrows to go through Apple mail on my MacBook as the arrows on the mail on the iPhone and the IPad up and down?  So annoying that I have to close the message I'm reading and then click on this message to every time.  Keep I hope that the next update with the fix of this commission, but it never happens.

    You could always just show in the display pane.

  • Not fully functional mouse with MacBook Pro 2010. I can scroll up and down, but can not move the cursor.  The mouse works with my new Macbook 12. No mouse problem but Macbook Pro?

    Not fully functional mouse with MacBook Pro 2010. I can scroll up and down, but can not move the cursor.  The mouse works with my new Macbook 12. No mouse problem but Macbook Pro?

    What specific mouse?

  • How to cancel the last update, it works better and makes more sense!

    before I upgraded to the nxt version, everything was more easy to use and MAKES MORE SENSE

    • Click Start
    • Click on Control Panel
    • Click on uninstall a program
    • Click Mozilla Firefox in the list
    • Click on the button uninstall
    • Make sure that you do not remove personal settings etc.
    • Install version 28.

    That's how I did it.

    HTH
    Jottum

  • Expansion or dé - one screen with CTRL - and CTRL + breeze a div in iframe in a containing more or less random ad. These keys have other meanings?

    In Internet Explorer, Chrome and torch pages can be increased / decreased at will by using 'CTRL -' and ' CTRL + '. Not the case in Firefox.
    It breaks a line a line with photos randomly. The right picture more moves to the left underneath, as if the div becomes smaller.
    But a second or a third or a nth CTRL-/ + fix the situation. You can see for yourself on www.vakantiehuiszonneweelde.nl
    The site is a "margin: auto container ' with navigation header and a content div. The problems occur within the content DIV. In one page, I use a lib (sort of lightbox) Magicthumb. This lib is the troublemaker?

    A good place to ask for advice on web development is the forum mozillaZine 'Web Standards Development/evangelism'.

    Aid to this forum are better informed on issues related to web development.

    You must register on mozillaZine forum site to post in this forum.

  • Firefox is stirred up and down even with all extensions disabled

    In the last two days that my browser started to "shake", a problem I had some time ago but has managed to get rid of the advice following I found somewhere on the internet (but stupidly made a point of). I have disabled all add-ons and plug-ins, but that has not solved the problem. The only bar showing menu is the navigation bar.

    Maybe it's just a coincidence, but it started shaking at the time I downloaded inadvertently Hola. I removed the two programs Hola installed and followed the instructions to remove the Firefox search.

    Any help would be appreciated as the jumping from top and down is more annoying.

    Do in safe mode?

    Please try turning off hardware acceleration:

    Disable hardware acceleration

    Who help me?

  • Lately Firefox is no longer recognizing macros Macro Express and upper and down arrows do more work as it should.

    Macro Express works in all other browsers (and programs), but is no longer working in Firefox.

    The arrow pointing upwards and down arrow works in all other browsers, but in Firefox, instead of moving her down (or up) a line at a time, the page will move much, much down (or climb). The Page Up and Page Down buttons work only part of the time... If an arrow down (or up arrow) has been used, the arrows Page move the page but not one page upwards or downwards... lots of pages pointing upwards or downwards.

    If I need to revert to a previous version of Firefox, I'll do that. Please tell me how to work the way they need to work things out.

    Work again in Thunderbird too. I did nothing to fix it on my machine. It was weird.

  • When opening my e-mail address, the E-mail entire table up and down for about 5 seconds. Because of the motion, I opened that badly. How to stop this movement?

    I use ASUS computer laptop and windows 7. When I opened my e-mail, the whole e-mail message table continues to move vertically for about 5 seconds and would then become immobile. Then only I can select a message and open. When I'm done with the reading of a message, and close it, it goes up and down motion again. Because of this instability, sometimes I open or delete the wrong message. What is the problem, can anyone help?

    First of all, update Firefox 16.0.1. Update Firefox to the latest version

    Then, try to read Web sites look bad or appear differently than they should and Refresh Firefox – reset settings and Add-ons. This could be just pictures of loading slowly, you have a slower internet connection with this computer?

  • page up and down and the arrow keys do not work, they do on any other programs

    Page up and down and the arrow keys do not work or jump at the bottom of page.

    You may have accidentally entered mode 'Keyboard Navigation. The F7 key will toggle "Keyboard Navigation" on or off.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

  • Up and down arrow keys not working not

    I got the HP Pavilion g6t - 1B 00 CTO Notebook PC now for a year or two. I have been having some problems with internet connectivity and put my computer to "sleep".

    However, a few days ago my keyboard randomly started acting strangely. When I would try to type some numbers of the letter /, they would come out differently.

    E.g. by pressing the space bar arise "." ' / M ' instead

    I tried to restart my computer several times and installed an update of the BiOS that fixed all my issues except for my up and arrow keys. From now on, they have no function; I can't scroll with them and they don't seem to take the role of another key. I tried to use the keys on different programs. The key to using scroll works, but I still can't use the keys and.

    Is there anyway to get the top and down arrow keys to work again?

    Larasoft,

    You can do it yourself; It is not too terrible a task to accomplish.

    Here is the Service Manual for your computer and page 50 are the instructions to remove the keyboard.  To actually get the keyboard itself you can contact HP support at 1-800-474-6836 if you reside in the United States or to the Canada or click on this link and select your location, and the number is provided for you.

    Now if you feel comfortable, the HP support service can provide you with a quote to get the keyboard replaced directly through them so that the option is still possible.

    If I was helpful, or if you want to say thanks you can click the White Star under my name to give me congratulations.  I really appreciate it.

    Please answer as soon as possible.

    Thank you

Maybe you are looking for

  • Where to find the Windows 7 language packs

    I am trying to add an additional language in my win 7. I know how to change, BUT I can not findWindows 7language packs on my windows... And its really annoying me as I much 'how to' red (this is why I know how to do yet) and they all say the same thi

  • How do my msn Windows live email?

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: You have problems with programs Error messages Recent changes to your computer What you have already tried to solve the problem

  • Certmgr.msc add the certificate to all users on a single machine

    I have a certificate for a Web site and I can install it only by using the local administrator, (for the local administrator account) that is to say: only the local administrator can go directly to the site that the certificate is installed. There ar

  • error code oxc 0000417

    This error prevents me sending mail from OUTLOOK

  • How to check the Windows registry for you ensure that it is correct in Vista?

    How a 'clean', or their "Windows registry", to ensure that it is still correct? Windows has a program, or the download for this?* original title - how can I check or clean, my Windows registry? Windows have a program, or download for this? *