How detect shift key release when both shift keys are pressed

Why is no event fired when a shift key is released if both shift keys were pressed?
1. Press left shift - keydown event
2. Press right shift - keydown event
3. Release left shift - no event
4. Release right shift - keyup event
So, we have two keydown events and just one keyup event.

I think that the two shift keys are logically the same key and both provide VK_SHIFT. Since they are the same key, it's still down when the left key goes up and so no up fires. This behavour is inherited from the underlying keyboard input system and is the
same as you'll see if you handle WM_KEYDOWN and WM_KEYUP in a Win32 app.
You can differentiate the VirtualKey.LShift and RShift keys with CoreWindow.GetKeyState() or GetAsyncKeyState(), but there isn't a direct way to catch your state #3 in action.

Similar Messages

  • How to sync your mouse and key board to the desk top when both the indicators are flashing?

    How to sync your mouse and key board to the desk top when both indicator lights are blinking?  I changed the batteries and I dont know how to sync them when they both wont work to follow the step to sync them up...help!

    The frozen was not clear in your first post…..
    Have you turned the computer off and then back on (force quit if necessary by holding the power button)?
    Try resetting the SMC:
    Shut down the computer.
    Unplug the computer's power cord.
    Wait fifteen seconds.
    Attach the computer's power cord.
    Press the power button to turn on the computer.
    Barry

  • I have a 27" desktop mac running with OSX 10.6.8.  The bluetooth keyboard started not typing when some of the keys are pressed. Plugged in a wired keyboard, started doing the same thing.  Now the cursor moves but cannot select anything.  Suggestions?

    I have a 27" desktop mac running with OSX 10.6.8.  The bluetooth keyboard started not typing when some of the keys are pressed. Plugged in a wired keyboard, started doing the same thing.  When opening up a browser or application, the cursor moves but cannot select anything.  Suggestions?

    Maybe something in these Apple support articles will help.
    Keyboard Doesn’t Work
    Keyboard Keys Do Not Respond
    Keyboard/Mouse – Troubleshooting Wireless

  • How to khow how many foreign key are referenceing the primary key

    sir i would like to know that how many foreign key are referencing the primary key of a table
    is any command to know the table name
    please suggest
    thanks in advance..

    In the query below, table_name is the name of the table whose primary key is referenced.
    SELECT b.owner owner
    ,b.constraint_name foreign_key
    ,b.constraint_type constraint_type
    ,b.table_name referencing_table
    ,b.r_constraint_name primary_key
    ,c.table_name referenced_table
    ,c.column_name referenced_column
    FROM all_constraints a
    ,all_constraints b
    ,all_cons_columns c
    WHERE a.owner = b.owner
    AND a.table_name = :table_name
    AND a.constraint_type = 'P'
    AND b.r_constraint_name = a.constraint_name
    AND b.constraint_type = 'R'
    AND c.constraint_name = a.constraint_name
    AND c.owner = a.owner;
    If the name of the primary key is known, the query below
    select * from all_constraints where constraint_type = 'R' and r_constraint_name = :pk_name

  • Bluetooth Wireless Keyboard acting as if keys are pressed

    I've had an Apple Aluminum Bluetooth keyboard for over two years, and last week (after a fresh install of OS X Lion on my late 2009 Mac Mini) all of a sudden the Mac is acting as if multiple keys are pressed when nothing is touching the keyboard. I have updated all software, replaced the batteries, deleted and re-paired the keyboard (which was a massive struggle as it acted as if keys were depressed even during the pairing process). Nothing has ever been spilled on the keyboard. The only way to make the sound of the "phantom depressed key" go away and regain full control of the computer, is to remove the batteries from the keyboard.
    Strangely, the problem seemed to have been resolved somehow after I placed the "Show character viewer" icon in the main menu (ie. where there is usually a US/other nationality flag). After doing so, all of a sudden the problem disappeared.
    Now, exactly a week later, the problem has reappeared.
    Can anyone explain why a keyboard would act this way? Has anyone had a similar problem? Is there a fix?
    I'm a longtime reader of theese support discussion boards, but this is the first time I've posted. Let me know if there's information that I can provide that would help us solve this issue.
    Cheers.

    I have similar issue: both left and right shift keys time to time being pressed, it disappears after a while...but once I couldn't log in as the shift option puts caps lock on....really annoying.
    The only reason in my case is the keyboard cleaning that I have done recently...
    There is no quick fix for this I am afraid.
    Options:
    1.Apple replaces the keyboard you pay around £200 I think....
    2. Buy new keyboard on Ebay and replace it yourself £40....
    http://www.ifixit.com/Guide/MacBook+Pro+13-Inch+Unibody+Mid+2010+Keyboard+Replac ement/23632#s61162
    Anyway lets see.

  • IPhone letters don't pop up when keys are pressed

    You know how the letters pop up from under your finger when keys a pressed on the keyboard to let you know which key you press, well sometimes certain letters on my keyboard stop popping up. A restart fixes the key but a few minutes or hours (intermittent) later a different letter stops working. Anybody else have this problem?

    The problem seems to be related to the Auto-correct and Auto-capitalization feature. If I turn either one off (Settings->General->Keyboard), I don't have the problem but when both are on, it comes back. It also seems to affect the first character that I type in the input field.
    With both Auto features on, if I go to the login page of Twitter and type, say, a 'v' as the first character of the Username, a capital V is entered and the "V" pops up, but if I backspace, tap shift to go to lowercase and tap v again, the v does not pop up from the keyboard but it does show up in the username input field. I can reset things if I tap the Done button on the keyboard then tap in the username field to bring the keyboard back up. The problem is still there, but I can see it happen with a new letter if I want.
    Try it and post what you find. You don't have to have a Twitter account to see it happen and I'd be interested to know if it's consistent.

  • No key event when compose keys are pressed

    I am supporting a legacy application for Sabre which maps some of the keys differently. For example, on a French keyboard the Compose key which is used to put a ^ on top of the vowel characters is to be remapped to produce a special character called a "Change Character" that has a special use for reservation agents that use Sabre
    The problem is, the first time you press the ^ compose key there is no key event apparently because the VM figures it doesn't yet know what key to report, it is expecting you to press a character such as 'o' and then you get an 'o' with a '^' on top of it.
    If you press the ^ compose key a second time, you get the following key events:
    keyPressed
    keyTyped
    keyTyped
    keyReleased
    On the screen you will see two ^ characters appear. Currently I remap the ^ character to the "Change Character", and I suppress the second keyTyped event so that I only get one character. The problem is that the user ends up having to press the key twice to get one "Change Character."
    I have no fix for this problem because there is no key event produced when they press the ^ compose key the first time.
    By the way, this behavior appears to have been introduced with jdk 1.3. The older jdk did produce a key event the first time you pressed the compose key. I would expect that this behavior was considered to be a bug and was fixed in jdk 1.3.
    Is there some other way to detect when the user presses a compose key? If not, is it possible for future jdk releases to report a keyPressed event when a compose key is pressed? This event would not cause a character to appear on the screen, but would allow programs to detect when the compose key is pressed.
    There is already a key on the French keyboard that behaves this way. It is the key to the left of the '1' key and it has the pipe symbol on it. If you press Shift plus this pipe key, no character is produces but a keyPressed event with a keycode of 222 is produced. I merely point this out to show that there is a way to report key events whithout producing output on the screen.
    Thanks, Brian Bruderer

    I don't know if this actually helps, but it seems that you can bind an Action to a dead key like the circumflex of the French keyboard
    Keymap keymap = textPane.addKeymap("MyEmacsBindings", textPane.getKeymap());
    Action action = getActionByName(DefaultEditorKit.beginAction );
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_DEAD_CIRCUMFLEX);
    keymap.addActionForKeyStroke(key, action);I saw this on a Swing tutorial and modified it slightly. Have a look at it :
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
    Chris

  • JSlider -- catch when arrow keys are pressed

    Hi,
    With a JSlider, when it has focus and a user presses the left/right arrow keys ..the thumb on the slider is moved to a new value. I tried adding a keyListener but that didnt work...how can I catch when a left/right arrow key is pressed??
    thanks

    You can take over the binding, but you will be responcible for the action....
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class KeyMappingEx extends JFrame
    JSlider slid;
        public KeyMappingEx()
            super( "Key Mapping Ex");
            setDefaultCloseOperation( EXIT_ON_CLOSE );
            slid  = new JSlider( 0, 100, 50 );
              slid.setMajorTickSpacing( 20 );
            slid.getInputMap( ).put( KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0, false),
                                       "RIGHT_ARROW" );
            slid.getActionMap().put( "RIGHT_ARROW", new RightAction(  ) );
            slid.getInputMap( ).put( KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0, false),
                                       "LEFT_ARROW" );
            slid.getActionMap().put( "LEFT_ARROW", new LeftAction(  ) );
            setContentPane( slid );
            pack();
            setLocationRelativeTo( null );
            setVisible( true );
        public static void main( String[] args )
            try
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch( Exception e )
            new KeyMappingEx();
        class RightAction extends  AbstractAction
            public void actionPerformed(ActionEvent e)
                System.out.println("RIGHT ARROW");
                slid.setValue( slid.getValue() + slid.getMajorTickSpacing() );
        class LeftAction extends  AbstractAction
            public void actionPerformed(ActionEvent e)
                System.out.println("LEFT ARROW");
                slid.setValue( slid.getValue() - slid.getMajorTickSpacing() );
    }

  • How to find out which keys are pressed while a d&d drop occurs?

    Hi,
    while an item is dropped as part of a drag and drop operation, I would like to know if the user has pressed any keys.
    I use a TransferHandler for managing the d&d and this works fine with the system dependent modifier keys for move, copy and link. But as my application needs to perform special actions if, for example, 'p' is pressed while a drop occurs, I'm stuck:
    It looks like there is neither a way to poll for pressed keys [like Keyboard.isPressed('p')] nor are there any key events fired as long as the d&d operation is active.
    I've tried a adding a key listener, adding a key binding and using the KeyboadFocusManager but nothing seems to work.
    Any ideas?
    Thanks,
    Norb

    Hi,
    the question is where the focus would be - because as you know unless there is a record in InputMap and keys are usually only received by focused component anyway. I'd recommend hooking into Swing event queue, something like that:
    Toolkit.getDefaultToolkit().getSystemEventQueue().push(new EventQueue() {
        protected void dispatchEvent(AWTEvent event) {
            if (event instanceof KeyEvent && dragging) {
                // do something
    });

  • Some applications behave as though modifier keys are pressed

    I am experiencing occasions when some applications behave as though modifier keys are being pressed (ie Command Key, Option Key and Shift Key). At first I thought the problem was isolated to Adobe Creative Suite Applications but have now found that MYOB is also affected. I have tried multiple keyboards (even no keyboard) so I do not believe it is a keyboard hardware problem. I am running on the hardware and software listed below.
    When the problem occurs it immediately affects all applications listed below in the way described. Many other applications appear unaffected. The only way I have found to fix the problem is to reboot the machine. After rebooting, the problem may not reoccur for several days, or may reoccur within half an hour. This problem has been occurring since some time in December 2010. I have also confirmed that none of the behaviour listed below occurs when the problem isn't present.
    Affected Applications & Observed Behaviour:
    - Adobe Photoshop CS4: All tools behave as though the option key is being pressed (rendering them unusable).
    - Adobe Dreamweaver CS4: When clicking on the contents of an open file, Dreamweaver behaves as though Cmd+Opt is pressed (ie the code navigator appears making the program unusable)
    - All applications in Adobe CS4 Suite: Upon startup, each application behaves as though CmdOptShift is pressed (resets preferences).
    - MYOB: When the cursor is in a data field, the delete key behaves as though the option key is pressed (ie entire field is deleted rather than a single character)
    I have been working with Adobe telephone support without success for about 3 weeks but since noticing the problem also affects MYOB, it now seems feasible that it is caused by something outside of the Adobe Creative Suite.
    Any help would be appreciated.
    Message was edited by: Leon Borrack

    Leon,
    You are not alone - I sometimes suffer a similar issue and I don't use any Adobe software. For me, it manifests itself as modifier keys being pressed in Safari, Mail or Finder. This normally happens shortly after a wake from sleep. I'm using an old-style Bluetooth Apple keyboard on a Mac Pro 1,1. I can't tell you what causes it, but I can tell you the solution that I've found: If I relaunch Finder the problem goes away...
    To relaunch Finder (apologies if you already know this), press 'Cmd-Option-Escape', select 'Finder' and click relaunch. For some reason the seemingly stuck modifier is cleared. It's not an terribly elegant solution, but it is a lot quicker and less disruptive than rebooting.
    Hope that helps a little.
    Greg

  • Firefox crashes when the apostrophe and tilde keys are pressed

    Pressing either the apostrophe key or the tilde key is crashing Firefox. It's also happening in other internet browsers and programs (like Skype and Google Talk). I've tried a new keyboard and using different USB ports for it. The first time I tried a new USB port it temporarily fixed the problem, but after restarting my computer for updates the issue returned.
    Firefox, the plugins, add-ons and drivers are all up to date from what I can tell.

    do the crashes occur too when you run firefox in [[Safe Mode]]? (close all firefox windows & press the shift key while launching firefox again)
    probably not related - there's a new version of the flash plugin available. you can install it from [http://get.adobe.com/flashplayer/] (disable the checkbox for bundled software)

  • Xorg shutting down when certain keys are pressed

    Hello after some recent updates, I've experienced that xserver is shutting down and I need to restart my computer to get a working a system back.
    When I hold keys like backspace arrow keys this happens, anyone experienced the same lately?

    (II) config/hal: Adding input device Logitech Logitech BT Mini-Receiver
    (EE) config/hal: NewInputDeviceRequest failed (8)
    (II) config/hal: Adding input device Logitech Logitech BT Mini-Receiver
    (EE) config/hal: NewInputDeviceRequest failed (8)
    (II) config/hal: Adding input device G15 Keyboard G15 Keyboard
    (EE) config/hal: NewInputDeviceRequest failed (8)
    (II) config/hal: Adding input device Gaming Keyboard
    (EE) config/hal: NewInputDeviceRequest failed (8)
    (II) config/hal: Adding input device Gaming Keyboard
    (EE) config/hal: NewInputDeviceRequest failed (8)
    (II) config/hal: Adding input device Logitech USB Gaming Mouse
    (EE) config/hal: NewInputDeviceRequest failed (8)
    (II) config/hal: Adding input device Macintosh mouse button emulation
    (EE) config/hal: NewInputDeviceRequest failed (8)
    I have disabled the hotplugging in my config.

  • How to fire an alert when a particular fileds are updated

    Hi,
    We have requirement in which an alert need to fire only when two of the columns of per_All_assigments_f table
    gets updated
    Can any one please let me know how to capture and compare the old and new values of any columns in the table in alert.
    Thanks
    SK

    Hi;
    You can create trigger than when related filed updated you can get email.
    Check below googling:
    http://www.google.co.uk/search?hl=en&q=update+trigger&meta=
    Regard
    Helios

  • Blackberry typing when no keys are pressed

    Hello,
    I have a BB Tour 9630. The problem that I am having is that every 5 seconds the letter "q" is typed on the screen without any buttons being pressed. This happens when I am using the browser, sending a text, trying to place a call and also when the blackberry is just setting on the desk. I have pulled the battery and also reset the blackberry and reloaded the software. Does anyone have any suggestions?
    Thanks,
    Ryan

    Hi and Welcome to the Forums!
    I suggest you contact your service provider for warranty evaluation.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to remove event listener when all the MoviClip are off the stage

    Hi i am newbie to as3,
        I am creating animation using as3 in which i duplicate the circle ten time,then pushing into an array and giving random motion. When all the duplicate object goes outside the stage then i should remove the event listener. But right now when one duplicate object goes off the stage the event listener is removed. Thanks in advance

    //---------code for creating random bubble movement------//
    var bubbleNo:Number = 10;
    var vx:Number = .3;
    var vy:Number = .5;
    var bubbles:Array = new Array();
    var bubbleRadius:Number = 9;
    var myColor:ColorTransform = this.transform.colorTransform;
    init();
    function init():void {
    for(var i:Number = 0; i<bubbleNo; i++){
              var bubble = new newBall();
    bubble.x = Math.random() * stage.stageWidth;
    bubble.y = Math.random() * stage.stageHeight;
    //bubble.color = Math.random
    //trace("bubble.x=="+bubble.x+"bubble.y=="+bubble.y);
    bubbles.push(bubble);
    myColor.color = Math.random() * 0xFFFFFF
    bubble.transform.colorTransform = myColor;
    addChild(bubble);
              addEventListener(Event.ENTER_FRAME,createBubble);
    //addEventListener(Event.ENTER_FRAME,createBubble);
    function createBubble(event:Event):void{
    for(var k:Number = bubbles.length-1; k>0; k--){
              var bubble = (newBall)(bubbles[k]);
              bubble.x += vx;
              bubble.y += vy;
              if(bubble.x - 18 > stage.stageWidth || bubble.x + 18 < 0  || bubble.y - 18 > stage.stageHeight || bubble.y + 18 < 0){
                        removeChild(bubble);
                        bubbles.splice(k, 1);
                        //trace("out"+bubbles.length);
                        if(bubbles.length <= 0 );
                                  removeBubble();
                                  trace(bubbles.length);
                                  //removeEventListener(Event.ENTER_FRAME,createBubble)
                        trace("all Bubbles cleared");
                        function removeBubble():void{
                                  removeEventListener(Event.ENTER_FRAME,createBubble)

Maybe you are looking for