Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

key events

 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you have multiple key events? by that i mean say you press the right arrow key, or a number on the numeric pad, then you press the letter c. does the second key event get fired? and i can catch both events?
 
Sheriff
Posts: 21997
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you try it and find out?
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, this might depend on the keyboard (the hardware) you're using.

Keyboard generally generates repeated keydown events when you press and hold a key on the hardware level (I hope I remember it from my old DOS days correctly). When you press another key, the keyboard sends the keydown event for the new key and stops sending keydown events for the old key, even if you continue to hold it down. When you release a key, a keyup event is sent.

Moreover, some keyboards are able to register more keys pressed at once than others; I remember some keyboards marketed to gamers who needed to press multiple keys at once to execute certain actions in games. Cheaper keyboards might not send keydown events for the third or fourth key pressed simultaneously.

It's easy to try without writing a single line of code: simply open a document in some word processor, try to press various keys simultaneously and see what's happening. Just make sure not to save the document afterwards
 
Randall Twede
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from what you say, i don't think it will be a problem.
i might need to have 3 + left arrow + c (example)
i am just thinking about an idea at this point anyway
 
I AM MIGHTY! Especially when I hold this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic