Keys Potential Bug

Posted By: DLively

Keys Potential Bug - 04/19/15 06:09

I'm sure this is a bug, because I just tested it with other buttons and it works fine, (And what I'm doing should be do-able) so:

I am making use of WASD, and CUL CUR CUU CUD for primary movement keys (Different combinations have different effects) so when I am pressing key_s and key_cud at the same time, the keys work together. then while still holding those keys(S and CUD) I try to press A and CUR, but they will not work at the same time. Examples:

Code:
#include <acknex.h>
#include <litec.h>
#include <default.c>

function main(){

	level_load(NULL);
	
	while(1){wait(1);
		
		if(key_s && key_cud && key_a && key_cur) {beep();wait(4);}
		if(key_s && key_cud && key_d && key_cur) {beep();wait(4);}
		if(key_s && key_cud && key_a && key_cul) {beep();wait(4);}
		
		//-- This is the only one that works
		if(key_s && key_cud && key_d && key_cul) {beep();wait(4);}
		
	}	
	
}



Just copy this into a new script, save it as whatever.c and give it a try for yourself.
Posted By: alibaba

Re: Keys Potential Bug - 04/19/15 07:43

I guess you´re working on a Laptop/Notebook, because they have a limitation that you can´t mostly press more than 3 keys at a time. I believe it was because of the port of the keyboard, which did not allow more than 3 key combinations or something.
Some key combinations with more than 3 may work, but they are very rare. So this is not gamestudio related.

Posted By: Anonymous

Re: Keys Potential Bug - 04/19/15 15:30

+1 confirmed script runs perfectly fine even with my newer laptop, this problem is isolated to your hardware or environment.
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 15:42

Im using a Desktop with windows 7 Home Premium, And it doesnt work on any pcs ive tested it on. Try again? tongue

You should only get a beep on the fourth set of combinations.

Also It works fine with other keys. Those are the only combination it wont work for.
Posted By: Anonymous

Re: Keys Potential Bug - 04/19/15 15:50

Quote:
Try again? tongue

As stated this script works perfect for me.
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 16:10

Thanks Malice laugh

When I have some time, Ill construct something a bit more complex for testing because it should NOT work.

I've tried it on 3 individual pcs (win 7, win 7, and win 8) and get the same results in all aspects of the game on each pc.. You're using a Frisbee, so ill condense my code as soon as I can for debug purposes, and if you have time perhaps you can test it laugh
Posted By: Anonymous

Re: Keys Potential Bug - 04/19/15 16:14

PM me the code when your ready or a dl link for like dropbox, I'll test away.
For now when all 4 button are pressed, there maybe a slight pause however the beep sound with ever combination.

Goodluck
Mal
Posted By: WretchedSid

Re: Keys Potential Bug - 04/19/15 16:20

As Alibaba stated, this is not a software limitation but purely a hardware one. The term for this is Rollover.
Posted By: Wjbender

Re: Keys Potential Bug - 04/19/15 16:43

yip was common with low end keyboard hardware aswell , there's also something about the way the keys are wired up all together , some keys can work and others not ,depending on the harware differences sometimes .

if you really want a lot of keys working together and great response , buy a gaming keyboard.

I had one and it was kick ass..

oh yeah here

http://gaming.stackexchange.com/question...-button-presses
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 17:52

Hmm... Well I want the average Joe to be able to play this game... is there no way around this other than purchasing a good keyboard? I think I read in the wiki I may be able to re-arrange my syntax to fix this, but I may have misread that in hopeful thinking..
Posted By: Reconnoiter

Re: Keys Potential Bug - 04/19/15 18:32

Use mouse? You don't want to let users play 'Twister' with there fingers anyway tongue

Other possibility is maybe using a key to change the modus/effect of the keys. Like that the user can press spacebar to toggle the effects of pressing some keys. That way you can add multiple effects to one key in a certain modus. Tricky to get the overal feel right though but maybe worth a shot?
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 20:24

Thanks for your suggestion Reconnoiter, but I was really hoping to use the arrow keys and WASD keys at the same time for two different players.
Posted By: Anonymous

Re: Keys Potential Bug - 04/19/15 21:00

Using the wasd and a joy_stick is achievable. Xbox 360 for windows or something. Also I believe 2 joysticks is achievable.
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 21:02

Thanks for your suggestion malice. I've considered that, but I'm trying to keep it on the keyboard laugh
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 21:14

and on a regular keyboard, WASD / IJKL doesn't work either. so numpad is only way to go.

how many people on the forum here have a numpad?
Posted By: Anonymous

Re: Keys Potential Bug - 04/19/15 21:26

-1
Posted By: WretchedSid

Re: Keys Potential Bug - 04/19/15 21:29

There is honestly no guarantee for it to work with the numpad on all keyboards. But for the record, I don't have one on any of my keyboards or laptops.

Maybe redesign your game to use the local LAN or use gamepads or something?
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 21:46

The purpose is to control two characters with one keyboard that work together, without swapping between them. It would be nearly impossible to control them without using the keyboard with both.
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 21:50

Hey sid, just out of curiosity (since your the guru laugh ) why wouldn't that work for all numpad keyboards?
Posted By: Anonymous

Re: Keys Potential Bug - 04/19/15 22:12

I'm not Sid, but I assume it's about the device buffer. But hopefully Sid will give a better answer.
Posted By: WretchedSid

Re: Keys Potential Bug - 04/19/15 22:57

Originally Posted By: DLively
why wouldn't that work for all numpad keyboards?

The same reason any four key combination can fail on a keyboard that doesn't support more than three keys reliably. Here is an article that explains it much better than I ever could.
Posted By: DLively

Re: Keys Potential Bug - 04/19/15 23:48

Okay. Fair enough grin Ill take a look at that laugh

Thanks Sid
Posted By: Wjbender

Re: Keys Potential Bug - 04/20/15 08:52

also on laptop's like mine , the numpad is integrated into the keyboard's alphabet but you have to access it with a function key and the numbad pressed together or a function key plus num lock , to keep it on or off .

extremely difficult because it adds another key or /and effectively disables those alphabetical keys while in use .
Posted By: Reconnoiter

Re: Keys Potential Bug - 04/20/15 09:50

From Sid's link:
Quote:
Usually, keyboards will report as many unambiguous keys as they can. However, the standard reporting protocol limits the number of simultaneous keys to six QWERTY keys plus the modifiers (such as shift, control, and alt).
, does this mean that with most keyboards you can actually press 9 keys (6 + 3 modifiers) at the same time, even if it would be a bit weird stance?

Anyway, if I were you, I would check older games to see how they solved the problem of having multiple persons playing on the same keyboard (anyone remember jump & bump with the rabbits? you can play it with 4 persons together on the same keyboard iirc).

Than there are the SNES and Neogeo simulators with e.g. beat-them-ups where 2 players can play on the same keyboard.

Perhaps another possibility is attaching 2 keyboards to the computer (keyboards can be very cheap), maybe that would work even though it would be a bit akward grin .
Posted By: Wjbender

Re: Keys Potential Bug - 04/20/15 10:37

even older games had the problem , I remember racing games when played on split screen ,players keys had to be selected carefully because if both players pressed the accelerate buttons while turning , one player couldn't turn unless the other stopped turning.

http://www.microsoft.com/appliedsciences/antighostingexplained.mspx
Posted By: Reconnoiter

Re: Keys Potential Bug - 04/20/15 11:36

That's the same article as Sid posted wink. (which is a good article by the way)
Posted By: Quad

Re: Keys Potential Bug - 04/20/15 12:58

there gaming keyboards with virtually no rollover and ghosting. They can be kind of pricey though. I can confirm i can press 10 keys at the same time with g710+. Did not try with more, i have 10 fingers.

also this article states the 6 key limitation in USB controllers have long been solved:
http://www.tomshardware.com/reviews/mechanical-keyboard-razer-logitech-gigabyte,3505-6.html

last paragraph.
Posted By: Anonymous

Re: Keys Potential Bug - 04/20/15 15:40

Solution - Contact a Gaming keyboard company and bundle your game with their keyboard like oem MS Windows.

Lol, sorry I couldn't resist.
© 2024 lite-C Forums