This is how it is done in the plane & tank mod.
PHP Code:
self execClientCmd("bind m openscriptmenu -1 m");
self waittill("key_m");
PHP Code:
monitorExKeys()
{
self endon( "intermission" );
self endon("disconnect");
if( isDefined( self.monitorExtraKeys ) )
return;
self.monitorExtraKeys = true;
wait (1);
if( !isDefined( self ) )
return;
while( isDefined( self ) )
{
self waittill("menuresponse", menu, response);
if( menu == "-1" && isAlive( self ) && response.size == 1 )
{
self notify( "key_" + response );
}
}
}
(run on each player)
But you can also use the supported keys by libcod e.g. space, left/right/up (forward)/down (back) arrows, lean left/right (Q/E) and aim button (left mouse).