Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Mar 19, 2024 4:46 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Issue with input
PostPosted: Sun Nov 04, 2007 7:51 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I have read the problem in the Maniadrive forum about keyboard input and now i was thinking about a keyboard setup system.
But i have found 1 big problem:

We can store the key pressed with something like:

Code:
int raydium_control_key_get(char *control,int current_control)
{
    int previous_key;
    previous_key=raydium_control_key[current_control];
    raydium_control_key[current_control]=raydium_key_last;
    if(previous_key==raydium_control_key[current_control])
    {
        return 0;       
    }
    else
    {
        raydium_log("The control %d, called \"%s\" has been attached to key %d",current_control,control,raydium_control_key[current_control]);
        return 1;
    }
}


In somewhere into the display a loop should run something like:
Code:
switch    (step)
{
    case 0:
        if(raydium_control_key_get("Forward",step))
            step++;
        break;
    case 1:
        if(raydium_control_key_get("Backward",step))
            step++;
        break;
    case 2:
        if(raydium_control_key_get("Left",step))
            step++;
        break;
    case 3:
        if(raydium_control_key_get("Right",step))
            step++;
        break;
    case 4:
        control_ready=1;
    default:
        break;
}


When control_ready==1 we assume the new keyboard setup is ready.
However here comes the problem. Even if we have stored the new keys we can NOT USE them in the game.
The reason: normal keys can not be readed with raydium_key.
To get a good response for the games we should code something like:

Code:
if(raydium_key[raydium_control_key[1]])


But Raydium won't allow that. The raydium_key[] array won't be filled with standar keys.

Xfennec, how can this be workarounded?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 11, 2007 10:51 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
The input layer of Raydium needs a complete (but simple) rewrite. Application must be able to ask for events (standard/special keys and axes) and the user should be able to map anything (keyboard, joy or even mouse) on these events. All this is stored into a config file in .raydium, of course. Application must be able to provide a default, IMHO.

"mindview":
Code:
main():
raydium_input_register("forward",RAYDIUM_INPUT_AXIS);
...
// in a menu where user can change controls:
raydium_input_gui_show();
...
display():
double v;
v=raydium_input_value_name("forward");


Or something like that ...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 12, 2007 1:24 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
So i should wait until that rewrite.
Not enought skills to do that rewrite for myself I'm absolutelly ignorant about input coding. :?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 12, 2007 5:18 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
We need that new "input layer" for ManiaDrive 2 too, so it must be done in a not so long future.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group