I'd use both timers and a complex "SWITCH" setup.

Not functioning code.
Code:
...
var key_timer =0;

var run_yes = 0; // false
var comboo_1 = 0; // false

while(1)
{

if(key_cur) 
key_timer = 10;
if(key_1) 
key_timer = 5;
if(key_2) 
key_timer = 5;
...Subtract timer here...

switch(key_lastpressed )
{
  case 77:
    if(key_timer >0)
    if(key_cur)
    run_yes =1;
    //... Call run function or code below switch
    break;

  case 2:
    if(key_timer >0)
    if(key_1)
    comboo_1 = 0.5;
    else
    {
    comboo_1 = 0;
    key_timer = 0;
    } 
    break;

  case 3: 
   if(key_timer >0)
    if(key_2)
    comboo_1 = 1;
    //... Call comboo function or code below switch
    else
    {
    comboo_1 = 0;
    key_timer = 0;
    } 
    break;

  default:
    printf("None of them! ");
    break;
}

wait(1);
}



reading ...
http://www.conitec.net/beta/akeyboard.htm
http://www.conitec.net/beta/akey_a.htm
http://www.conitec.net/beta/akey_lastpressed.htm
http://www.conitec.net/beta/switch.htm
http://www.conitec.net/beta/acrt-break.htm

You can also use a time and an array to store last-hit key scan codes. Using a "For" loop you can check the array for patterns of combos each frame.

so like
Code:
......
var key_timer =0;
var key_store[5];
var key_index_max = 4;
var key_index =0;

while(1)
{


if(key_cur) 
key_timer = 10;
if(key_1) 
key_timer = 5;
if(key_2) 
key_timer = 5;
...Subtract timer here...

 switch(key_lastpressed)

switch(key_lastpressed )
{
  case 77:
    if(key_timer > 0)
    {
    for(key_index =0; key_index <= key_index_max; key_index++)
    {
      if(key_store[key_index] == 0)
        {
       key_store[key_index] = 77;
         break;
       
     } 
     }
     else
     {
       for(key_index =0; key_index <= key_index_max; key_index++)
        key_store[key_index] = 0;
      }
    run_yes =1;
    //... Call run function or code below switch
    break;

  case 2:
    ......
    break;

  case 3: 
   .........
    break;

  default:
    printf("None of them! ");
    break;
}

//....... Checking the array
if(key_store[0] !=0) // ?One key was hit
{
  if(key_store[1] !=0)
   {
   if(key_store[0] == 77 && key_store[1] == 77 )
     ///...Call RUN here
    }
}
wait(1);
}



http://www.conitec.net/beta/for.htm
http://www.conitec.net/beta/keys_c.htm

The above code doesn't work and is bugged, but you should get an idea of how you can use it to build a combo system.

Also please check the AUM mags, I'm sure a combo system has been done before.

Last edited by DriftWood; 10/25/17 20:03.