Re: [info-performer] Key Releases

New Message Reply Date view Thread view Subject view Author view

From: Serge Kourdakov (serge++at++sat-sim.org)
Date: 07/10/2002 00:28:48


Hi Dimi you wrote in message

[info-performer] Key Releases 07/05/2002

>is it possible to detect KEY RELEASES using pfutil >funtions?

I do not know if pfutil will help you but I found what seems will solve some
of your probs

http://sdldoc.csn.ul.ie/guideinputkeyboard.php

http://www.libsdl.org/index.php sdl is a multiplatform lib and you could
link it to commercial projects ....

the example of a code using this lib found on the net looks like ( I think
to port it to Performer will be quite straigforward ..)
-----------------------------------------------------------
static void process_events( void )
{
SDL_Event event;

while( SDL_PollEvent( &event ) )
{
case SDL_KEYDOWN:
g_input.key_down( event.key.keysym.sym );
break;
case SDL_KEYUP:
g_input.key_up( event.key.keysym.sym );
break;
}
}

void Input::key_down( const int keysym )
{
    key_states[ keysym ] = PUSHED;
}

void Input::key_up( const int keysym )
{
    key_states[ keysym ] = RELEASED;
}

static void loop( void )
{
process_events( );
g_os.update_timer();

if ( g_input.key_states[ SDLK_z ] == Input::PUSHED )
g_scene.cam.move_forward(1);
-------------------------------------------------------------

Regards
Serge
http://www.vrtainment.de


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jul 10 2002 - 02:41:49 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.