Hat switch for view control with SIOC
Hi! Need a sioc expert advice.
I have struggled with a hat switch on a slaughtered CH Yoke to try to make work as pov hat to use for changing views.
I have come so far that I got it to shift the views properly except for the up button.
The up button has to be set to "pan_up" so that I can use it to tilt with in outside view. But that's no biggie since I use the "ptt" button in front of the hat to reset the view forward in cockpit view.
The hat switch is 4 separate buttons and I've managed to program them so that I have seven views (forward missing as explained earlier).
What I cant get to work is having the commands repeating so I don't have to push several times in outside view to pan.
Having looked at Nico page on how to do an auto repeat function but I can't implement it on my code. Now maybe there's an easier way of coding this but that's over my head.
Here's my code:
Var 0080, name hat_up, Link IOCARD_SW, Input 58
{
IF &hat_up = 1
{
IF &hat_left = 0
{
IF &hat_right = 0
{
&Send_fscontrol = 65734 //pan_up
}
}
}
IF &hat_up = 1
{
IF &hat_right = 1
{
&Send_fscontrol = 65856 //pan_right_up
}
}
ELSE
{
&Send_fscontrol = 0
}
}
Var 0081, name hat_right, Link IOCARD_SW, Input 61
{
IF &hat_right = 1
{
IF &hat_up = 0
{
IF &hat_down = 0
{
&Send_fscontrol = 65672 //pan_right
}
}
}
IF &hat_right = 1
{
IF &hat_down = 1
{
&Send_fscontrol = 65857 //pan_right_down
}
}
ELSE
{
&Send_fscontrol = 0
}
}
Var 0082, name hat_down, Link IOCARD_SW, Input 59
{
IF &hat_down = 1
{
IF &hat_right = 0
{
IF &hat_left = 0
{
&Send_fscontrol = 65735 //pan_down
}
}
}
IF &hat_down = 1
{
IF &hat_left = 1
{
&Send_fscontrol = 65855 //pan_down_left
}
}
ELSE
{
&Send_fscontrol = 0
}
}
Var 0083, name hat_left, Link IOCARD_SW, Input 62
{
IF &hat_left = 1
{
IF &hat_down = 0
{
IF &hat_up = 0
{
&Send_fscontrol = 65671 //pan_left
}
}
}
IF &hat_left = 1
{
IF &hat_up = 1
{
&Send_fscontrol = 65854 //pan_left_up
}
}
ELSE
{
&Send_fscontrol = 0
}
}
Var 0084, name Send_fscontrol, Link FSUIPC_OUT, Offset $3110, Length 4