Page 1 of 2

Possible addition to framework :D

Posted: May 6th, 2012, 11:27 am
by Sleet
Sooo recently I have been getting the urge to use more keys instead of just the arrow keys, space, and enter. Thus I have ended up expanding on the framework to include almost all the keys (except for print screen, scroll lock, pause/break, window start menu key, and pretty much any add on keys that are used to open apps or volume and such) which I figured might be a nice little release for anyone that wants it that is if chilli will allow ^^. Anyways its late so I will look forward to a possible answer later today (heh... 6am ftw...) hopefully :D.

P.S. I can include print screen, scroll lock, pause/break, and windows start menu key if requested though they seemed to be least important except for maybe the print screen. As for the others well if it does get released I will just let you brush up on your google kongfu to figure that part out.

Re: Possible addition to framework :D

Posted: May 6th, 2012, 4:33 pm
by chili
Sounds good bro. It might save some work for other board members who need to use more keys. ;)

Re: Possible addition to framework :D

Posted: May 7th, 2012, 11:02 am
by Sleet
Well I had some errors with the distinguishing of left and right shift, ctrl, and alt sooo be later today/tomorrow before I release it since its kinda pointless to release a bug riddled program but allas its late and I must sleep for like an hour.... anyways night and hope to get this thing out soon sorry for the delay ><

EDIT::Working ;D
I uploaded a folder with an example of using a couple different keys though I will leave you guys to looking through the files to see all the keys.

Little Bugs
Idk if it was just me but when using to many keys such as both shifts to control speed and then direction that it wouldn't allow either down and up and left and that the trying to detect alt keys that it won't seem to work so afraid that one is up to you guys to figure out sorry :I

Re: Possible addition to framework :D

Posted: May 8th, 2012, 2:06 pm
by keramsege
Could you explain, where you changed things in the framework, because i didn't understand it.
Thank you.

Re: Possible addition to framework :D

Posted: May 8th, 2012, 2:48 pm
by LuX
Thanks, this will come handy!
You probably should have just uploaded the c++ source and header files, opposed to the whole framework.

Re: Possible addition to framework :D

Posted: May 8th, 2012, 2:56 pm
by LuX
Could you explain, where you changed things in the framework, because i didn't understand it.
Thank you.
He added more key presses that you can use, instead of just having arrow keys, space and enter that chili added. Edits are done in Keyboard.h, .cpp and windows.cpp I think

As for multiple button presses, there's a thing called key ghosting or something like this. Essentially your computer has limited space to detect key presses. Usually keyboards that work through usb might have less key press detection at once.

Re: Possible addition to framework :D

Posted: May 9th, 2012, 5:30 am
by Sleet
To LuX:
I uploaded the whole framework to add a temporary example of how to use as it has a check in keys function for like right shift or left ctrl (running off memory so might be something else).

To keramsege:
You can find all the keys by looking in the keyboard cpp/header or you could type in the framework kbd. and a list should appear that will display all the possible keys.

Re: Possible addition to framework :D

Posted: May 10th, 2012, 7:33 pm
by keramsege
To Sleet:
So you just wrote the code in the headers, like chili did and you can use other keyboard keys? You didn't need to use the directX headers, too? I ask, because I tried, to add some keys, too,but it didn't work

Re: Possible addition to framework :D

Posted: May 10th, 2012, 8:40 pm
by LuX
I had some problems too, but I just added the new keys to a fresh framework and then copy pasted my old code to this new one and worked perfectly.

It looks like just adding the new source makes the framework forget to update this new code.

Re: Possible addition to framework :D

Posted: May 11th, 2012, 4:09 pm
by Sleet
To keramsege:
Basically all I went in and did is add functions for the keys in the header files and windows.cpp file. Meaning if you took my framework and used it you shouldn't have to include anything as it includes the keyboard anyways. (the kbd( kServer ) near the top of game.cpp) so all that would have to be done is type in something like

if ( kbd.WIsPressed() )
//some action that is wanted done because of the W is currently being pressed


and it should work just fine. Do note that all of the keys are case sensitive and you can find them all in the keyboard.h file or looking through the list that is brought up after typing kbd.
LuX wrote:It looks like just adding the new source makes the framework forget to update this new code.
I get what you mean ( i think at least lol ) but I don't know why this is happening. You might try adding your code back and see if it still has the errors and "refresh" them and by that I mean you can click at the end before the semi-colon and enter a space and delete it and it will sometimes fix a problem with the program not realizing it was suppose to work. Also might try to clean the project and see if that would have helped.