Possible addition to framework :D

The Partridge Family were neither partridges nor a family. Discuss.
Sleet
Posts: 12
Joined: March 3rd, 2012, 6:51 pm

Possible addition to framework :D

Post by Sleet » May 6th, 2012, 11:27 am

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.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Possible addition to framework :D

Post by chili » May 6th, 2012, 4:33 pm

Sounds good bro. It might save some work for other board members who need to use more keys. ;)
Chili

Sleet
Posts: 12
Joined: March 3rd, 2012, 6:51 pm

Re: Possible addition to framework :D

Post by Sleet » May 7th, 2012, 11:02 am

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
Attachments
Chili DirectX Framework (Sleets Additional Keys).zip
yay more keys
(65.1 KiB) Downloaded 271 times

keramsege
Posts: 7
Joined: April 24th, 2012, 6:28 pm

Re: Possible addition to framework :D

Post by keramsege » May 8th, 2012, 2:06 pm

Could you explain, where you changed things in the framework, because i didn't understand it.
Thank you.

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Possible addition to framework :D

Post by LuX » May 8th, 2012, 2:48 pm

Thanks, this will come handy!
You probably should have just uploaded the c++ source and header files, opposed to the whole framework.
ʕ •ᴥ•ʔ

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Possible addition to framework :D

Post by LuX » May 8th, 2012, 2:56 pm

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.
ʕ •ᴥ•ʔ

Sleet
Posts: 12
Joined: March 3rd, 2012, 6:51 pm

Re: Possible addition to framework :D

Post by Sleet » May 9th, 2012, 5:30 am

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.

keramsege
Posts: 7
Joined: April 24th, 2012, 6:28 pm

Re: Possible addition to framework :D

Post by keramsege » May 10th, 2012, 7:33 pm

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

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Possible addition to framework :D

Post by LuX » May 10th, 2012, 8:40 pm

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.
ʕ •ᴥ•ʔ

Sleet
Posts: 12
Joined: March 3rd, 2012, 6:51 pm

Re: Possible addition to framework :D

Post by Sleet » May 11th, 2012, 4:09 pm

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.

Post Reply