Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Nov 2002 14:13
...have a function to allow a defined set of game commands be mapped to keys/mice/joypads (ie allow redefining actions to any key) ?

I dont particularly want to write my own y'see...
Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 14th Nov 2002 11:28
Not sure if this helps :-



Using this you can do a menu like in most FPS games, where the user presses the key they want for the function, you then just store the scancode (or -1 for lmb or -2 for rmb)in a variable (eg upkey, downkey etc) and in your code you can simply do 'If pressed(upkey) then ypos = ypos + 1' etc

It does not have Joystick commands but they would not be too difficult to add (except maybe the analog controls).
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Nov 2002 13:33
Thats basically how I'm going to do it - I was just wondering if anyone had any generic code for defining actions and allowing them to be re-defined via keyboard/mouse/joypad movement..

I'm debating whether to do it in Windows or DarkBasic. I dont want to initialise and enumerate DirectInput devices (as its a pain), so I'ld have to use the higher-level joystick functions. Getting keyboard and mouse presses/moves will be a pain too.

Unfortunately it wont be much easier in DBPro either...

Yes, I really am THAT good...
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Nov 2002 13:38
Couldn't be have built-in command for this (would save me lots of trouble) :

function allowFunctiomMapping(functions as string,currentKeys as cotrolType).

That brings up the list of functions and the keys/joystick/mouse they're currently assigned too..

Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 14th Nov 2002 18:08
Uh....No, if you find one/do one yourself could you post it here.

Its odd that there are not more DLL`s available yet, I would have thought all those C++ coders would be churning stuff out by now.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Nov 2002 19:31
Indeed... they would have solved me a lot of trouble...

...ah well, better start designing it

Yes, I really am THAT good...
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Nov 2002 23:46
Thats annoying - Windows Multimedia extensions only allow detection (for movement etc) of two joysticks. Before I have to result to DirectInput, does anyone know how to detect JOYSTICKS3-15 as a window message ?

Yes, I really am THAT good...
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 15th Nov 2002 00:43
I've been using a combination of MFC and DirectInput recently, use a standard wizard for the start of the program it sets all the basic enums for your automatically



DIJOYSTATE2 handels upto 128 buttons
hope that helps

Anata aru kowagaru no watashi!
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 15th Nov 2002 00:44


Anata aru kowagaru no watashi!
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 15th Nov 2002 01:43
Mines going well - I'll probably leave the 2 joystick/4 button GDI limit for the time being. Mouse and keyboard is working fine, so hopefully a 'demo' will be availiable in a few days (mainly sorting out the layout).

Yes, I really am THAT good...
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 17th Nov 2002 12:32
Just to let you know that a demo of this DLL will be availiable sortly - one thats sorted, I put in a wrapper for DBPro (the demo is my C test program), and finialise the functions.

Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 20th Nov 2002 17:30
Excellent, can`t wait!

(sorry for the slow reply, works gone a looney at the moment, I actually had to do some!).
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Nov 2002 18:20
Dont worry - I had to repair one of my Windows XP machines, and get the RAS system up and running again...

...fun

I've got a C++ test program on my web site - but not a DBPro one yet (the C version was done a while ago).

Yes, I really am THAT good...
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Nov 2002 01:02
I've uploaded the latest beta DLL and test program to my web site. It should now recognise all mouse buttons, main mouse movements, all joystick buttons, all joystick directions and all keys. All values should be saved.

The only problems left are :

Writing mouse and joystick layers in DBPro, and finding if DBPro joystick enumeration is in the same order as mine, so I know which joystick is being dealt with.

Yes, I really am THAT good...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 21st Nov 2002 14:39
Great stuff, I`ll take a look at that soon.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Nov 2002 15:20
Okay - I also need to upload some more of Microsoft's DLL's unfortunately to get it to work (just in case)...

Yes, I really am THAT good...

Login to post a reply

Server time is: 2024-04-20 13:26:41
Your offset time is: 2024-04-20 13:26:41