Added hooks for Swipe Control buttons

Related to issue #986
This commit is contained in:
Travis Nickles 2019-12-30 21:39:05 -06:00
parent 6b27a615dc
commit 58d533b1ca
3 changed files with 18 additions and 7 deletions

View File

@ -425,8 +425,7 @@ namespace DS4Windows
[DS4Controls.SwipeLeft] = "Swipe Left",
[DS4Controls.SwipeRight] = "Swipe Right",
[DS4Controls.SwipeUp] = "Swipe Up",
[DS4Controls.SwipeUp] = "Swipe Up",
[DS4Controls.SwipeDown] = "None",
[DS4Controls.SwipeDown] = "Swipe Down",
};
public static Dictionary<DS4Controls, int> macroDS4Values = new Dictionary<DS4Controls, int>()

View File

@ -118,7 +118,7 @@
<RadioButton x:Name="useTouchControlsRadio" Content="Use As Controls" GroupName="tpMode" Click="UseTouchControlsRadio_Click" Margin="10,0,0,0" />
</StackPanel>
<StackPanel x:Name="useMousePanel" Margin="0,10,0,0">
<StackPanel x:Name="useMousePanel" Margin="0,10,0,0" Visibility="Visible">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Height="20">
<CheckBox Content="{lex:Loc TouchSlide}" IsChecked="{Binding TouchSenExists}" />
@ -206,19 +206,19 @@
<StackPanel x:Name="useControlsPanel" Margin="0,10,0,0" Visibility="Collapsed">
<StackPanel Orientation="Horizontal">
<Button x:Name="swipeUpBtn" Content="Swipe Up" Width="70" />
<Button x:Name="swipeUpBtn" Content="Swipe Up" Width="70" Tag="36" Click="SwipeControlsButton_Click" />
<Label x:Name="swipeUpLb" Content="{Binding MappingName,FallbackValue=Unassigned}" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
<Button x:Name="swipeDownBtn" Content="Swipe Down" Width="70" />
<Button x:Name="swipeDownBtn" Content="Swipe Down" Width="70" Tag="37" Click="SwipeControlsButton_Click" />
<Label x:Name="swipeDownLb" Content="{Binding MappingName,FallbackValue=Unassigned}" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
<Button x:Name="swipeLeftBtn" Content="Swipe Left" Width="70" />
<Button x:Name="swipeLeftBtn" Content="Swipe Left" Width="70" Tag="34" Click="SwipeControlsButton_Click" />
<Label x:Name="swipeLeftLb" Content="{Binding MappingName,FallbackValue=Unassigned}" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
<Button x:Name="swipeRightBtn" Content="Swipe Right" Width="70" />
<Button x:Name="swipeRightBtn" Content="Swipe Right" Width="70" Tag="35" Click="SwipeControlsButton_Click" />
<Label x:Name="swipeRightLb" Content="{Binding MappingName,FallbackValue=Unassigned}" Margin="10,0,0,0"/>
</StackPanel>
</StackPanel>

View File

@ -1255,5 +1255,17 @@ namespace DS4WinWPF.DS4Forms
mpControl.UpdateMappingName();
UpdateHighlightLabel(mpControl);
}
private void SwipeControlsButton_Click(object sender, RoutedEventArgs e)
{
Button btn = sender as Button;
DS4Controls control = (DS4Controls)Convert.ToInt32(btn.Tag);
MappedControl mpControl = mappingListVM.ControlMap[control];
BindingWindow window = new BindingWindow(deviceNum, mpControl.Setting);
window.Owner = App.Current.MainWindow;
window.ShowDialog();
mpControl.UpdateMappingName();
UpdateHighlightLabel(mpControl);
}
}
}