Simultaneous ASDW key press undetected

Hi guys, I'm currently developing a game that uses ASDW buttons for its movement system
During one of my testing session, i realized that if i press 2 buttons simultaneously, (ex: A and S), both events would be dispatched one after the other (just like what i assume they would do)
But if i press 3 buttons simultaneously, (ex: A, S and D), the last keypress (D) will go undetected
Only after i release one of the keys (either A or S) will the last keypress be detected
From what i read here ==> http://blog.nobien.net/2008/05/12/more-than-two-simultaneous-key-presses-and-keyboardevent key_down-woes/
It is said that the problem might had been caused by a hardware issue
From what i read at wikipedia http://en.wikipedia.org/wiki/Keyboard_%28computing%29
[quote]
Some low-quality keyboards suffer problems with rollover (that is, when multiple keys are pressed in  quick succession); some types of keyboard circuitry will register a  maximum number of keys at one time. This is undesirable for games (designed for multiple keypresses, e.g. casting a spell while holding  down keys to run) and undesirable for extremely fast typing (hitting new  keys before the fingers can release previous keys). A common side  effect of this shortcoming is called "phantom key blocking": on some  keyboards, pressing three keys simultaneously sometimes resulted in a  4th keypress being registered.
Modern keyboards prevent this from happening by blocking the 3rd key  in certain key combinations, but while this prevents phantom input, it  also means that when two keys are depressed simultaneously, many of the  other keys on the keyboard will not respond until one of the two  depressed keys is lifted. With better keyboards designs, this seldom  happens in office programs, but it remains a problem in games even on  expensive keyboards, due to wildly different and/or configurable  key/command layouts in different games.
[/quote]
Question
- What causes this problem is it a hardware issue or a language/flash player problem?
Because i might be wrong, but i think i've played several non-flash games before that possess the ability to address multiple keypress at the same time
- Can this problem be fixed?
Code
package
        import flash.display.Sprite;
        import flash.events.KeyboardEvent;
        public class Keyboard extends Sprite
                 public function Keyboard()
                        this.stage.addEventListener("keyDown", showKey);
                public function showKey(event:KeyboardEvent)
                        trace(event.keyCode);
Any help regarding the matter is greatly appreciated, thank you in advance~

Quote
do you think an update of the bios will do the trick?
No, no, no, it won't, so please don't try it!
Also, if you read the comments in the link you posted, your answer is there:
Quote
By Tony Fendall on May 12, 2008 | Reply
The problem comes from the way in which the signal for the pressed keys moves from your keyboard to your computer. The signal is only 8-bit, and there are limits to how the signal can be changed to represent more than one key being pressed in combination.
Long story short, the guys who designed the origional keyboards made a descision to support all two key combinations, and then selected as many three key combinations as they could support with the hardware. This meant that some combinations had to be left out, and they had to make a descision about which ones were more important.
It just happens to be that they chose not to support three key combinations which involve the up arrow key. I do not think there is any solution to this problem…
If you're playing games, why not just remap the keys in the game's settings?

Similar Messages

  • Simultaneous key press on the keyboard GX600

    hello guys,
    i bought a MSI GX-600 thinking that it could accommodate my gaming needs however i found out that it cannot allow more than 2 simultaneous key presses on the keyboard. its supposed to be a gaming laptop right? i cannot play keyboard bashing games with this unless i use a gamepad or an external keyboard. have you experienced this on your laptop? 
    do you think an update of the bios will do the trick?
    try this link to test if your keyboard can handle more than 2 keypress at the same time:
    http://blog.nobien.net/2008/05/12/more-than-two-simultaneous-key-presses-and-keyboardeventkey_down-woes/
    btw, i like this forum. 

    Quote
    do you think an update of the bios will do the trick?
    No, no, no, it won't, so please don't try it!
    Also, if you read the comments in the link you posted, your answer is there:
    Quote
    By Tony Fendall on May 12, 2008 | Reply
    The problem comes from the way in which the signal for the pressed keys moves from your keyboard to your computer. The signal is only 8-bit, and there are limits to how the signal can be changed to represent more than one key being pressed in combination.
    Long story short, the guys who designed the origional keyboards made a descision to support all two key combinations, and then selected as many three key combinations as they could support with the hardware. This meant that some combinations had to be left out, and they had to make a descision about which ones were more important.
    It just happens to be that they chose not to support three key combinations which involve the up arrow key. I do not think there is any solution to this problem…
    If you're playing games, why not just remap the keys in the game's settings?

  • What to use for the events of 2 keys pressed simultaneously?

    Question:
    What to use for the events of 2 keys pressed simultaneously? As the key listener has limited functionality, in this case, I need something that can act to two events (see below)
    Goal
    1. A user presses right and up at the same time
    2. Program responds to this event changing BOTH the vertical and horizontal speeds of the player
    Problem
    I currently have a key listener to do this, using key pressed, however, it only acts to up OR right at one point in time. So the user can only increase his or her vertical speed; or horizontal speed at one point in time. Instead of increasing them both.
    Example
    Here is an example of the game: http://www.kongregate.com/games/MINDistortion/bubbles-2

    DarrylBurke wrote:
    I don't know whether there's a better way (or whether this will work as expected), but I would try setting a boolean flag on keyPressed and reset the flag on keyReleased, for each key of interest. To compute the x / y movements, I would check the state of all flags.
    dbI was thinking about your answer a few nights ago. And I was like, wait... it works! I thought, at first (as I replied before) that it wouldn't work, but I refract what I said. Its actually a very simple solution. And I apologize for questioning your solution previously. Thanks so much!
    P.S. I tested it out. Works like a charm.
    -Create booleans to handle each key
    -Set to true on press
    -Set to false on release
    -Check and update in separate thread accordingly

  • Down arrow key press autometically an3 simultaneously

    My hp pavilion g6 has a problem.the down arrow key press automatically and simultaneously after sometime.please tell me how to i get ride of this.

    The down navigation key do not work.please help me.

  • Amount of key presses a user makes over time - BPM

    Hi,
    Im working on a small program that needs to get the amount of keypresses a user makes over time.
    Basically its for calcuating the BPM a user is inputting. So a uers taps a beat for 5 seconds and the amount of tap is saved and multiplied by 12 to get the Users BPM.
    So far i have this:
    package Version1;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.util.Timer;
    import java.util.TimerTask;
    import javax.swing.*;
    public class muTap extends JFrame implements KeyListener, ActionListener {
        JTextArea display;
         * main - the main method
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    theGUI();
         * muTap constructor
        public muTap(String name) {
            super(name);
         * theGUI - creates the gui for muTap
        public static void theGUI() {
            muTap frame = new muTap("muTap");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Set up the content pane.
            frame.addComponents();
            //Display the window.
            frame.pack();
            frame.setVisible(true);
         * adComponents - adds gui components to muTap
        public void addComponents() {
            JButton button = new JButton("Start");
            button.addActionListener(this);
            display = new JTextArea();
            display.setEditable(false);
            display.addKeyListener(this);
            JScrollPane scrollPane = new JScrollPane(display);
            scrollPane.setPreferredSize(new Dimension(375, 125));
            getContentPane().add(scrollPane, BorderLayout.PAGE_START);
            getContentPane().add(button, BorderLayout.PAGE_END);
        public void keyTyped(KeyEvent e) {
            //Do Nothing
        /** Handle the key pressed event from the text field. */
        public void keyPressed(KeyEvent e) {
            //TODO call the getBPMfromKboard() method
            taps++;
            System.out.println("Tap: " + taps);
        /** Handle the key released event from the text field. */
        public void keyReleased(KeyEvent e) {
            //Do Nothing
        /** Handle the button click. */
        public void actionPerformed(ActionEvent e) {
            //Do Nothing
            //initialCountdown(3, "Start Tapping Fool");
            countDown(3);
         * countDown - a simple countdown timer for use when getting users input.
         * @param time amount of time to count down from
         * @return      true when timer ends.
        public static int taps;
        public void countDown(final int time) {
            taps = 0;
            final Timer timer = new Timer();
            timer.scheduleAtFixedRate(new TimerTask()
                int i = time;
                public void run()  {
                    i--;
                    String s = Integer.parseInt(i); // error because of this i.
                    display.setText(s);
                    if (i < 0) {
                        timer.cancel();
                        if(time == 3)
                            display.setText("Start Tapping");
                            countDown(5);
                        else if(time == 5)
                            display.setText("Number of taps: " + taps);
                            //System.out.print("Number of taps" +taps);
            }, 0, 1000);
    }But i get errors when i try running it:
    "Exception in thread "Timer-1" java.lang.RuntimeException: Uncompilable source code"
    It doesnt seem to like me parsing int to string here:
    String s = Integer.parseInt(i); Any ideas? or if youve got suggestions on another way to do it it'd be much appreiated.
    Thanks!

    Korvanica wrote:
    It doesnt seem to like me parsing int to string here:
    String s = Integer.parseInt(i);
    Yikes, you've got that bit of code backward, there partner.
    You use Integer.parseInt to parse a String into an int, not the other way around.
    If you want to change an int to a String, do
    String s = String.valueOf(i)or you can use the various formatters out there.

  • 2 key pressing at a time?

    i am currently making a java application that require 2 key pressing a the same time with KeyPressed(KeyEvent e)but it doesnt seem to work.does any body know how to do it? thanks

    This is only supported with the "meta" keys (Control, Shift and Alt). Look at the KeyEvent for the methods to determine which meta key was pressed in combination with the other key.

  • Trap Key pressed in Forms 10g.

    Hi All,
    Have anyone trapped the keys which are pressed in Forms 10g. We have a requirement in which in a LOV Form when TAB key is pressed it should navigate to the next field and when ENTER key is pressed it should select the value from that field and get back to the field from where it was invoked.
    We had tried http://forms.pjc.bean.over-blog.com/article-15980196.html from Francois Degrelle which traps he key pressed. But that is throwing us some error in JInitiator console.
    Expecting a favorable reply from the forum users on this to .
    Thanks in advance

    Monsieur Degrell,
    is it possible to listen just to one item in the form?
    I have triedSet_Custom_Property( 'b_hilfe.bean', 1, 'INIT', 'b_help.search');in when-new-form-instance, where 'b_help.search' is the item i want to listen to,
    but the bean still listen on every item in the form.
    kind regards

  • How to get the actual key pressed in a UITextField

    Hi all , now i develop a program on iphone SDK 3.0 GM.
    I have an UITextField (created programmatically) and I have implemented the delegate as well as the UITextFieldTextDidChangeNotification so that I can react to changes in the text values.
    However, I specifically want to know when the user presses the backspace key in the UITextField when there is currently no text in the field. I can't find where I can get a specific notification of the actual key pressed, as opposed to the resulting state of the text. I'm sure there is a way to do this...help?

    I can imagine why you want to do it. I had the same problem myself and managed to circumvent it in a slightly painful way. What I did was to subclass UITextField to create a text field that always had text in it, even when it "seemed" empty. In fact the first character of the text is a space character, and then what follows is the actual text. In this way, your delegate will always get called about a backspace (when it's an attempt to delete the leading space character, obviously you should return NO in the textField: shouldChangeCharactersInRange: replacementString: method). I won't get into the details of exactly how to set everything up, like I said it is kind of elaborate and I wouldn't really recommend it unless you are desperate to have that kind of functionality.

  • Key Press Not Responding If You Go Back (re-do step)

    I have a software simulation in which one of the steps is to enter some numbers into a text field and press the Enter key. Works good on the first pass. If you then click the Back button and go back to a previous step the Enter key will no longer work. I have search the forums and some blogs without any luck.
    Example:
    http://elearning.biworldwide.com/misc/Soft_Sim/Soft_Sim.htm
    After you reach the text entry step and enter the correct numbers and press Enter, click the Back button (lower left) and back up to the Click Member step and re-preform the steps. When you reach the text entry the Enter key press will no longer work.
    Source CP4 file:
    http://elearning.biworldwide.com/misc/Soft_Sim/Soft_Sim.zip
    Thanks for any assistance,
    Kevinhttp://elearning.biworldwide.com/misc/Soft_Sim/Soft_Sim.htm

    All apps in the recently used apps bar or dock which is accessed by pressing the home button twice are not loaded and running. Some apps like games that have been updated to do so will be in an idle state, most will be quit, and some will run in the background when leaving the app. The number of apps that can run in the background are very few and far between because there is no reason or benefit for the overwhelming number of 3rd party apps to run in the background.
    http://whenwillapple.com/blog/2010/04/19/iphone-os-4-multitasking-explained-agai n/

  • How to pass the key pressed in javascript

    I'm asking this question here as I could not find the needed help elsewhere .
    I don't know how to pass the key pressed in the function on OnKeyPress event .
    I'm trying the following :
    <input type="text" name="a" onKeyPress="check();">
    I want to pass the key presses in the check function .
    How to collect the key pressed in the function check ?
    Thanks.

    As I said above, that won't work in Mozilla.
    In fact IMO Netscape/Mozilla javascript event handling has been behind IE since version 4.
    Be that as it may: here is a workaround (for Mozilla): It seems you have to assign the onkeypress event for it rather than declaring it as part of the textfield.
    Of the two textfields on this form, both work in IE, and only the first one will work properly in Mozilla. I left it in just to demonstrate the difference.
    And a couple of links for ya
    javascript forum: http://forums.webdeveloper.com/forumdisplay.php?s=&forumid=3
    Keypress events: http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/KeyEvent.htm
    <html>
    <head>
    <script language="javascript" >
    <!--
    function check(evnt){
      alert("A key was pressed!");
      // IE handling
      if (window.event){
        evnt = window.event;
        alert(evnt.keyCode);
      // netscape/mozilla handling 
      else{
        alert(evnt.which);
    //-->
    </script>
    </head>
    <body >
    <form name="myform" method="post">
    Test <input type="text" name="myTest"><BR>
    Test <input type="text" name="myTest2" onKeyPress="check();"><BR>
    <script> document.myform.myTest.onkeypress = check; </script>
    </form>
    </body>
    </html>

  • Key pressed event

    I need message to be displayed when certain key pressed. Why it's not working?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class TestKey extends JPanel implements KeyListener {
         public TestKey(){
              addKeyListener(this);
         public static void main(String arg[]){
               JFrame frame = new JFrame();
                  frame.setTitle("Test my keybord, man!");
                  frame.setSize(300, 200);
                  frame.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                      System.exit(0);
                  Container contentPane = frame.getContentPane();
                  contentPane.add(new TestKey());
                  frame.setVisible(true);
         public void keyPressed(KeyEvent ke){
              System.out.println("key pressed");
         public void keyTyped(KeyEvent ke){
              System.out.println("key typed");
         public void keyReleased(KeyEvent ke){
              System.out.println("key released");
    }

      public TestKey(){
        setFocusable(true);//<----------
        addKeyListener(this);
      }

  • Flash 9 Key press Problem

    Using Flash 9, when running an application from the IDE, key
    presses of K which are supposed to do something in my app are being
    captured by the IDE and doing something there instead.
    Didn't happen in flash 8, is there a way to disable / fix
    this.

    Plucka,
    > Using Flash 9, when running an application from the IDE,
    > key presses of K which are supposed to do something in
    > my app are being captured by the IDE and doing something
    > there instead.
    While in the SWF window you're testing in the IDE, go to
    Control >
    Disable Keyboard Shortcuts. Let me know if that does it for
    you. :)
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Flash Action Script Key Press Restrictions

    Hello, so I am making a Pacman game and am using the following script for the movement of my character.
    onClipEvent (enterFrame) {
              speed = 10;
              if (Key.isDown(Key.LEFT))
                        this._x -= speed;
                        _root.char.gotoAndStop(2);
              if (Key.isDown(Key.RIGHT))
                        this._x += speed;
                        _root.char.gotoAndStop(1);
              if (Key.isDown(Key.UP))
                        this._y -= speed;
                        _root.char.gotoAndStop(3);
              if (Key.isDown(Key.DOWN))
                        this._y += speed;
                        _root.char.gotoAndStop(4);
    The problem that I'm having is that when I press the right and down keys, or any other two keys that result in diagonal movement, the character moves in that direction.  I only want the character to be able to move right, left, up and down.  The   _root.char.gotoAndStop(3); part of the script is just so that the character faces in that direction.  Is there any way to restrict the number of keys that can be pressed at once to one? Or to make it so that only the first of the two keys or the second of the two keys pressed is used? If not, is there any way to make a RIGHT and DOWN key press result in diagonal movement that also faces the character that way? Or stops the character entirely? I would throuroughly appreciate any help on the matter! Thanks in advance!
    Walt

    One way would be to incorpate "else" 's for the last three conditionals.  That would make it so that the first key determined to be down would be the key that determines the movement.
    onClipEvent (enterFrame) {
              speed = 10;
              if (Key.isDown(Key.LEFT))
                        this._x -= speed;
                        _root.char.gotoAndStop(2);
              } else  if (Key.isDown(Key.RIGHT))          {
                       this._x += speed;
                        _root.char.gotoAndStop(1);
              } else if (Key.isDown(Key.UP))          {
                        this._y -= speed;
                        _root.char.gotoAndStop(3);
              } else if (Key.isDown(Key.DOWN))           {
                        this._y += speed;
                        _root.char.gotoAndStop(4);

  • Closing windows in Expose using key press (or why does apple-W not work?)

    I often end up with lots of Safari windows open & need to prune them down. (Yes I use tabbed browsing too .
    So I thought I'd use Expose, see the windows I needed to close, select the one I wanted to close and hit apple-W which works fine to close a window when not in Expose. However for me it doesn't work in expose (though its fine when not in expose).
    This leads to a rather slow process of going into expose, selecting the window you want to close, coming out of expose, then hitting apple-W to close that window, then going back to expose.
    I'd much rather just go into expose, hover over the window I want to close (or use cursor keys to pick the right one) and hit apple-W; then I can close a few windows without having to leave expose.
    Has anyone ever figured out a way to get apple-W - or any key press at all - to close the currently selected window in expose?
    BTW I know you can quit an application in Expose; which is great. However in this case I want to close just a selected window in expose (e.g. a particular safari window), not the whole application.

    You have a great idea. But it isn't supported. Yet.
    Send your idea to Apple (they read all submissions) http://www.apple.com/macosx/feedback

  • How to listen to key press in JTable

    I've been trying to listen to key press in JTable,
    However it only works if the cell is double-clicked.
    If the tab button is use or the cell is single-clicked, nothing happens to the listener.
    Anybody can help me???
    Thanks

    table.getColumnModel().addColumnModelListener(new TableColumnModelListener(){
      public void columnAdded(TableColumnModelEvent e){}
      public void columnMarginChanged(ChangeEvent e){}
      public void columnMoved(TableColumnModelEvent e){}
      public void columnRemoved(TableColumnModelEvent e){}
      public void columnSelectionChanged(ListSelectionEvent e){
        // column selection changed
    table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent event) {
        // row selection changed
    });rykk

Maybe you are looking for

  • How do i create a mail box in the SMTP server thru a java program

    How do i create a mail box in the SMTP server thru a java program. If it is possible thru a java program.pls suggest a mail server compatible for the above possibility to work. pls help ....

  • Change of  image in JLabel doesn't appear

    Hi! In my custom JPanel class, I add a JLabel with nothing in it. Then. When auser clicks a Button, I set an imageicon for this jlabel. but it doesn't appear until I force a repaint, e.g. by resizing the app. repaint(), validate() or invalidate() did

  • Mail and Keychain

    I have about 10 different mail accounts, on 2 of them only, the password won't register with my keychain even though I keep checking the box and then again only some of the times Any ideas ?

  • Other programs can't print other can

    Hi last time i could print from my windows picture viewer or microsoft office picture manager. Now when ever i print it just prompts the print I can' t open printer options/color management it doesn't pop out anymore. and when you click print it just

  • Lumia 520: Can't connect to 3G after software upda...

    unable to select 3g network in my lumia 520 after updating phone (docomo network) Moderator's note: We have amended the title of this post as this was moved from another thread.