Get all keys currently pressed

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Get all keys currently pressed

Post by Plu »

If anyone cares about the reason behind not being able to press certain key combinations, this article explains it really well:

http://www.microsoft.com/appliedscience ... ained.mspx
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Get all keys currently pressed

Post by jjmafiae »

Does the limitation have something to do with cats on keyboards?
User avatar
richardperkins
Prole
Posts: 9
Joined: Tue Jan 07, 2014 6:20 am

Re: Get all keys currently pressed

Post by richardperkins »

A possible solution for you and admittedly a shameless plug.

I made a module called "KeyMap" that allows you to bind keys and gamepad axis/buttons.

If you plan on tracking more than one key per mapping (ex. "up", "down", "left", "right", "fire", "jump", etc.); such as WSAD, arrow keys, gamepad axis, gamepad dpad, gamepad buttons, and so on; or would like users to be able to customize their controls, this might be useful. Check out the demo .love file if you're unsure.

I've been using it nonstop in my current project.

Hope this helps!
User avatar
Reenen
Prole
Posts: 44
Joined: Tue Nov 08, 2011 9:44 am

Re: Get all keys currently pressed

Post by Reenen »

I know this is a bit of a thread necro, but this is one of the best keyjamming* tools I've ever seen... (People sell this!)** It's even better than M$'s own one at http://www.microsoft.com/appliedscience ... splay.aspx

I just modified the fact that you can't see a spacebar on the screen, to say "space" when it is pressed, but other than that, perfect!

*: The terminology starcontrol 2 used for "ghosting"
**: http://www.passmark.com/products/keytest.htm (this crappy thing)

My keyboard is struggles a bit in this department. Pity most places doesn't allow you to load love and run a test program on the keyboard before buying one.

My current aim is 9 keys (numpad directions, numpad 5, numpad enter, and 3 others (currently E,R and space, but could be any)).

And actually it's only about 6 most of the time.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Get all keys currently pressed

Post by zorg »

Keyboards that have "NKRO" or n-key rollover, are not grouped and can handle every key being pressed at once (at least every alphanumeric, probably varies by keyboard maker), and most mechanical keyboards are marketed like this; then again, very old IBM keyboards worked the same way as well.
One issue with NKRO is that USB keyboards need special drivers to support it, but that means that you can't use the keyboard with the BIOS.
There are a few keyboard types, that can do both via smart engineering, but sadly i lost the link to one i did know about.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Get all keys currently pressed

Post by s-ol »

zorg wrote:... But that means that you can't use the keyboard with the BIOS.
There are a few keyboard types, that can do both via smart engineering, but sadly i lost the link to one i did know about.
Many mechanical keyboards have "BIOS mode", often as an additional choice for the profile switch that does this, but there might also be some that automatically switch between the two, I don't know about that.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests