More then 5 key-presses?

Hi there,
I'm trying to re-create a game that me and my friends have been playing quite a lot in the last few weeks. The game is called Kurve, and it's an offline multiplayer game. Up to six players can play the game on one keyboard.
The idea of the game is this:
Each player get's a snake and two keys. The snake moves around and the player has to steer the snake around using these two keys and try to survive as long as possible, without colliding with other snakes.
Now my problem:
I've got the base engine working, snakes can move around with any key they want, collisions are beiging checked etc. But when doing some extra testing I noticed that, when I press 4 random keys on my keyboard, I couldn't press any other keys.
This, however, is something that's important for the game and needs to be fixed if I'd ever want to release it.
I'm currently doing keypresses in the folowing way:
- implementing the KeyListener
- storing each key-presssed-code in a HashSet
- removing each key-released-code from the Hashset
- whe excecuting a step; checking if the HashSet containt a steering key for a snake
I hope I'm clear enough and that someone can help me.
~Sph
Message was edited by:
sph
Message was edited by:
sph

I found a great page about this phenomenon a while back, unfortunately I've lost track of it. The basic problem you're having is that keyboards are not, in general, designed for gaming. They're designed for typing, which means the developers can cut corners to save some cash by making assumptions; mainly that you won't be pressing many keys at once. Aside from the metakeys (Ctrl,Shift,Alt), the keyboard is wired into one or more grids of keys. Each key within the grid activates both the horizontal and vertical wire underneath it, and with the two wires the grid can determine which key was pressed. Consider this small arrangement of keys:
||
-AB-1
-CD-2
||
34Any individual key is easily identified, A=1&3, B=1&4, C=2&3, D=2&4. Two keys is a little trickier, but still doable. If A is held, B will activate 4, C will activate 2, and D will activate both 2 and 4. So we can still tell which two keys were pressed. At three keys, we have a problem. If A and D are pressed, all wires are already active, so pressing B or D won't accomplish anything. If, on the other hand, B is pressed, pressing either C or D will activate wire 2. This is more information, but still not enough. They keyboard can tell that either C or D was pressed, but not which. So any combination of two held keys and a third press either isn't be detected or is confusing, the keyboard can't tell what input it's getting. So it refuses to give any new output, except an error.
I'm afraid you've hit one of the problems that's been annoying gamers for years. The only real solution is to either explore and find out what combos are OK on your keyboard, or try and find a manufacturer who makes a better one. In the latter case, you might look at someone who makes keyboards specifically for gamers, they're more likely to alow multiple presses (but check first!). You'll probably end up paying a premium for it, but you may decide that's worth it to you.
-FM

Similar Messages

  • IPhoto opens but then the spinning rainbow wheel appears and I can't do anything. I have opend iPhoto with the Option key pressed and rebuilt the library and it still happens.  I want to at least access my photos and copy them to an external drive.

    iPhoto opens but then the spinning rainbow wheel appears and I can't do anything. I have opend iPhoto with the Option key pressed and rebuilt the library and it still happens.  I want to at least access my photos and copy them to an external drive. Anyone have ideas on how to get to them?

    Make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    OT

  • More then one Primary Key?

    During application building there is only a place to specify 2 primary keys. If I want to use more then 2 where would I do this at? Thanks Agains!!

    Not possible if you are using the Automatic Row Fetch and Processing DML.
    One workaround is to define a view, but that will have a drawback if you wish to use the returning clause (i.e. "Return Key Into Item" under Automatic Row Processing). This is because Oracle SQL does not support the returning clause with views.
    You have to develop the PL/SQL code to accomodate the custom table configuration with more than two primary keys.
    Regards,
    John

  • Changing images based on keys pressed

    Ok, I'm trying to make my character face a different direction when a key is pressed (when left is pressed, he faces left, when right is pressed, he is facing right). Right now I am going to load all the images into an array and then tell it which one to paint based on the key pressed. Anything faster or better?
    Thanks!
    -Brian

    Hmmm, javax. The javax packages usually accompany
    pain and torture... eerrrr, swing. I detest swing. I
    will use this for now, but do you know of any other
    ways to do this? Or is this not related to swing?The javax package contains alot more than Swing.
    Saying all javax packages are painful to use, simply because you don't like swing is silly.
    As for answering your question. Try re-reading the post by KarateMarc.
    You can either use MediaTracker (horrible, but it will let you know when the image is loaded) or ImageIO to properly load your images.

  • 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?

  • IdeaPad U330 key presses registered twice

    I bought a U330 about a month ago, and I'm wondering if anyone else has had trouble with their keyboard.  My issue is a bit vague and unpredictable: every now and then when I'm typing a lot, key presses will register twice.  This seems to most commonly happen with the 'm' and '-' keys; in fact about one in every five times I type "vim foo bar" at a console I end up producing "vimm foo bar".  Every now and again I get repeats with other keys, but it's not predictable.
    It is not a software configuration issue like changing the time delay between the input driver accepting a press-and-hold as multiple presses.  For fun I tried increasing this value as high as it would go (which gets to be around 500ms) and still no luck.  The hardware is clearly reporting two distinct taps when I'm physically making one.
    For a while I was convinced that I just needed to get used to this particular keyboard, but I'm convinced this keyboard is finnicky.  I'm a solid typist as I work in IT and have spent more than a few years of my life mashing at keyboard; I type quite firmly and quickly so I'm confident this isn't anything I'm doing wrong.
    Has anyone else seen this issue?

    Try updating the drivers and the BIOS.
    Here is a link to updating the BIOS: http://goo.gl/E9VFK
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • Key press elapsed time

    I'm building a shooting game. I want to record how long the player has the F key pressed in order to use that value to remove ammunition sprites from the stage.
    My application loops in frame 1.
    I have a script that subtracts the key press time from the system time on key release. I think the repeat rate of the keyboard is interfering with this as the output figures are quite random and holding the key down for longer returns a lower number.
    global gFire, gTotal, gStartTime
    on startMovie
      the keyDownScript = "handleKeydown"
      the keyUpScript = "handleKeyUp"
    end startMovie
    --Handler to fire
    on handleKeydown
      if the key = "f" then
        gStartTime = the milliseconds
      end if 
    end handleKeydown
    --Handler to stop firing
    on handleKeyUp
      if the key = "f" then
        gfire = (the milliseconds - gStartTime)/10
        gLeft = gTotal - gFire
        gTotal = gLeft -- gTotal is used to incrementally turn off sprite visibility
        put gfire -- Trace elapsed time to Message window
      end if
    end handleKeyUp
    --This sequence removes bullets from the stage\
    according to he time spent firing
    on enterFrame
      if tTotal < 900 then
        sprite(10).visible = False --this repeated for a sequence of 10 sprites
      end if
    end
    The other problem with this is that it doesn't update the stage till the key is released, so a player can defeat the logic by just holding the key down continuously (especially because the value of gFire doesn't increase as expected)
    Ideally I'd like to record the elapsed time the key is down, add it to a global and have it update the stage at the frame rate, so I guess it would have to be within a frame event handler.
    Any help would be gratefully received.

    MStewart,
    Thanks for doing that. I decided to do a little something like that and just reworked it a bit. Dropped the pause on a case structure and put the timer inside. seemed easier to do it that way for what I wanted to accomplish. The pause is going to be a good thing to have in the event that the heater needs to be turnd off and worked on for any reason, and it won't accrue time or cycles. Used a "in range and coerce" to compare minutes and seconds and then wired a 4 to 15 mA simulated signal to to the timer. All I got to do now is duplicate it 14 more times and then to work on the cDaq part of it to control relays through dig out signals, and sequence the whole thing to write a file for the analog in. Thanks alot for your help and BowenM too. like I said: you guys are awesome. Got me to thinking in other directions.
    Attachments:
    Mexico sentinal loop.vi ‏11 KB
    milliamp timer w pause function.vi ‏24 KB

  • Can you zoom in more then 100% without using the loop?

    If you press the 'Z' key, your photo will zoom to 100%, but is there a way to zoom more then 100%? I know that I can use the loop tool to do that, but I'd prefer to just have my viewer display at 200% instead.
    Thanks,
    Kenny

    If you display the image at full screen, then zoom, your image will appear to be way more magnified. Can't say exactly why.

  • 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?

  • Keep key pressed permanently?

    Hi there,
    I've been playing around with sticky keys, but here's what I really need.
    I need the Apple (command) button to remain pressed even after I've pressed another button/clicked the mouse.
    I'm selecting several files (but not all of them) and using the apple button to help me select them. But, I also need my left hand for other things while I'm doing this.
    Is it possible to keep the command button permanently pressed? Right now I'm holding it down with a hair clip...

    Yes, definitely!
    With sticky keys activated, if you press a modifier
    key once, then it will be used once.
    What you haven't discovered is what happens when you
    press that key again. If you press a modifier key
    twice (or a second time), then it will stay. Pressing
    it a third time will unstick the modifier key.
    You can see this happen by selecting "Display pressed
    keys on screen" in the Universal Access preferences'
    "Keyboard" tab. The key will appear slightly dim to
    show it won't stay, and it will become solid to show
    it will stay, and disappear when unstuck. You can
    stick more than one key, and unstick each one
    individually using this method.
    There are also aural cues, too.
    Azqi,
    I'm planning on getting a Macbook the latter part of June (my first mac after many years of using a pc). Being a quadriplegic I'll need to use stick keys and mouse keys. Is the Fn key also considered a modifier key and does the steps above also work with the Fn key?
    Dell Inspiron 8500   Windows XP  

  • Increment once per key press

    I'm trying to find the 'proper' method to do this basic concept of incrementing a value (in this example) once per key press:
    Is there a more efficient (using less cpu and/or less code) way to do this?
    I am also curious why you can't add shift registers to the case structure.
    Solved!
    Go to Solution.
    Attachments:
    Feedback node run once per button press.vi ‏9 KB

    martinv wrote:
    (Note I posted this before seeing the 2 replys that snuck in before this post)
    I think I get it.  Is this what you described (Pic Below)?
    I first thought the loop would be running continuously, but after putting on an indicator I see it does nothing until the case inside is finished. 
    Glad to see you figured it out.  Slight edits I recommend:
    1) Make a case in your event structure for the Stop:Value Change and put the stop terminal inside of that case.  You will then wire the value of the stop button (or a true constant) from that event case to the loop conditional terminal.  This will allow you to stop your loop immediately instead of being forced to wait for another event (or possibly 2) before actually stopping.
    2) I would use a shift register for the value.  This way other cases can affect/read the value without the use of a local variable.  Be sure to wire the value through all of the other cases.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • View more then one site

    Hi, I was wondering if anybody knows how i can view more then one web site at a time instead of having to minimize or close every single time? For example, on a PC there are tabs at the bottom of the screen and you can flip back and forth between site, can a MAC do anything like that?

    Hi
    Welcome to Apple Discussions and Mac computing.
    Go to the Safari Menu (to the right of the Apple Icon in the upper right of the screen) and select Preferences. When the Preference panel opens, select Tabs (if you don't see a Tab panel, click on the small pill button in the upper right). Check all available boxes. You'll see instructions for key commands on this panel to activate different aspects of Tabs. If you want to learn more about the Tab function, go to the Safari Help Menu and type "tabs" in the Search field.
    Once Tabs is activated, a Tab Bar appears, similar to what is created at the bottom of the IE window. To create a new tab, simply press the Command and T keys. If you want to open a link on a web site in a new tab, hold down the Command key when you click on the link.
    Good way to familiarize yourself with OS X is to pick up a copy of Scott Kelby's book OS X Tiger: Killer Tips.

  • Missed Key Press

    I first noticed missed key press after installing and later removing Bootcamp.
    After several months of missing key presses, I uninstalled Internet Explore.
    The missed key presses were gone (unnoticed) for more than a week and then they started intermittently.
    After the Bootcamp removal and before the Internet Explore removal, I would notice the cursor flash about 10 times and stop. Then the next key press would miss.
    After Internet Explore removal, I have not seen the cursor stop, but I still get missed key presses. I tested it just now, counted 100 cursor flashes and the next key press missed. Repeated 100 count again and key press okay.
    Summary:
    Missed Key Press:
    iMac 17", OS 10.5.8
    After Bootcamp uninstall, missed key press after 7-10 cursor flashes always.
    After IE removal, missed key presses seemingly random.
    I seen old posts (2006 - 2009) about missed key press which were archived without answers.
    Any help would be appreciated.

    Capslock blinking twice and then repeating  is a diagnostic error message that means that the BIOS is corrupt.
    Try a hard reset as follows:
    1) Remove the battery and unplug the DC power adapter.
    2) Press and hold the power button for more than fifteen seconds.
    3) Plug in the DC power adapter (leave the battery out for now)
    4) Press the power button
    Please post your positive or negative results here in your thread.
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Initiate key pressing tab key

    it there a code for initiate key pressing...once i start
    the flash application pressing the "tab" key code should
    automatically be initiated.
    i don't want to do something while pressing the tab button.
    the tab button just has to be "pushed" automatically since
    this step is necessary in order to start an external application.
    otherwise the user has to push it.
    it is more "comfortable" when pushing the tab button is done
    automatically by flash, and the user only has to push the enter
    button to start the application.
    thanks for help....

    we have an application that will be started from a flash
    projector.
    the menue will be controlled not by mouse but by a remote
    control.
    you start the application when you press a certain key at the
    remote control that is "linked" with the enter key on the keyboard.
    now it is two steps: press the tab key to select the start
    button, and then press the enter key (both by remote control) to
    start the application.
    the first step is unnecessary when this could be done
    automatically by flash. then the user only has to press the enter
    key because the start button is already "selected".
    i can't explain it better... ;-(

  • MessageTextInput  allows more then MaximumLength

    Hi,
    Our Uix file has a messageTextInput field, MaximumLength attribute is 250.
    When text is entered using key board it allows only 250 characters but we can paste(cut/paste) more then 250 characters in the messageTextInput. After pressing enter or TAB it truncates the field and only 250 characters are displayed.
    How to restrict users to paste less then 250 characters?
    The messageTextInput field is �.
    <bc4j:messageTextInput name="ShortDesc" prompt=""
    attrName="ShortDesc" columns="50"
    maximumLength="250" rows="5">
    <boundAttribute name="readOnly">
    <dataObject select="readOnly" source="ui:rootAttr"/>
    </boundAttribute>
    </bc4j:messageTextInput>

    Using the UIX that ships with JDeveloper 10G (UIX 2.2), I was unable to paste more characters than a regular <messageTextInput> allows. I used IE 6.0 as my browser.
    This behavior may be affected by the browser and UIX version you use.
    Ryan Pollock
    UIX Team

Maybe you are looking for

  • XSD showing many messages while mapping

    Hi experts Can anybody please tell me how to create a single message from one  xsd file(Imported in EXternal Definition) having multiple messages I get the dialog box as : Imported scheme has multiple global elements. Select the global element to be

  • New iPod work with PB G4 400 Titanium?

    I assume my PB is not USB 2.0 (I can't see how to tell), but that just means the new iPod will sync slower, right? It will work, just slower? Planning to buy one of the video iPods and want to ensure it will work. Thanks.

  • How do I get my Mac Apple ID to be my iPhone 5's Apple ID?

    I changed my Apple ID for my Mac but for some reason the change didn't go through to my phone. I can't plug my phone into my computer now, it says charging incapable and iTunes no longer reads my phone. So how so I get my Mac's ID to bet phone's ID?

  • Why would an alias file be larger than the original file?

    I have a simple document that is 106kb. When I create an alias to the file, the alias is 133kb. Why would the alias file be larger than the orginal file when the alias file is simply a redirect to the original file?

  • CProjects Usage in PS

    Hi everybody, Our client [in SMB market range] has a new product development project which involves stringent project management & quality control plans and uses Advance Product Quality Planning procedure [APQP]. I found that for their process of man