@@ -17,6 +17,8 @@ public static class KeymapPresetOperations
1717 const int Height = 70 ;
1818 const float FontSizePresetButton = 8.5f ;
1919 const string PRESET_BROWSING = "Browsing" ;
20+ const string PRESET_GAMING = "Gaming" ;
21+ const string PRESET_MOVIE = "Movie" ;
2022 const string MSG_PRESET_SELECTED = "\n *SELECTED*" ;
2123 public static void ChangeButtonTextForSelected ( Button prButton , bool makeSelected )
2224 {
@@ -53,20 +55,17 @@ static Button BuildPresetButton(string presetName)
5355 tb1 . Text = "[" + presetName + "]" ;
5456 tb1 . Font = f ;
5557 tb1 . BackColor = Color . Aquamarine ;
56- //tb1.Margin = new(100);
57- //tb1.Padding = new Padding(100);
5858 tb1 . MaximumSize = new ( Width , Height ) ;
5959 tb1 . MinimumSize = new ( Width , Height ) ;
6060 tb1 . FlatStyle = FlatStyle . Flat ;
6161 tb1 . Visible = true ;
6262 tb1 . TextAlign = ContentAlignment . MiddleCenter ;
63- //tb1.Dock = DockStyle.Fill;
6463 return tb1 ;
6564 }
6665 List < KeymapPreset > presetButtons = new ( ) ;
6766 presetButtons . Add ( new ( ) { ButtonForPresetSection = BuildPresetButton ( PRESET_BROWSING ) , KeymapName = PRESET_BROWSING , Keymaps = BuildPresetBrowsing ( ) } ) ;
68- presetButtons . Add ( new ( ) { ButtonForPresetSection = BuildPresetButton ( PRESET_BROWSING ) , KeymapName = PRESET_BROWSING , Keymaps = BuildPresetBrowsing ( ) } ) ;
69- presetButtons . Add ( new ( ) { ButtonForPresetSection = BuildPresetButton ( PRESET_BROWSING ) , KeymapName = PRESET_BROWSING , Keymaps = BuildPresetBrowsing ( ) } ) ;
67+ presetButtons . Add ( new ( ) { ButtonForPresetSection = BuildPresetButton ( PRESET_GAMING ) , KeymapName = PRESET_BROWSING , Keymaps = BuildPresetGaming ( ) } ) ;
68+ presetButtons . Add ( new ( ) { ButtonForPresetSection = BuildPresetButton ( PRESET_MOVIE ) , KeymapName = PRESET_BROWSING , Keymaps = BuildPresetMovie ( ) } ) ;
7069 return presetButtons ;
7170 }
7271 public static List < XMapLibKeymap > BuildPresetBrowsing ( )
@@ -91,6 +90,64 @@ public static List<XMapLibKeymap> BuildPresetBrowsing()
9190 new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWNLEFT , VKMappedTo = ( int ) Keys . A } ,
9291 new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWNRIGHT , VKMappedTo = ( int ) Keys . S } ,
9392 new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWNRIGHT , VKMappedTo = ( int ) Keys . D } ,
93+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LSHOULDER , VKMappedTo = ( int ) Keys . BrowserBack } ,
94+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_RSHOULDER , VKMappedTo = ( int ) Keys . BrowserForward } ,
95+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_A , VKMappedTo = ( int ) Keys . Space } ,
96+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_B , VKMappedTo = ( int ) Keys . E } ,
97+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_X , VKMappedTo = ( int ) Keys . R }
98+ } ;
99+ return mp ;
100+ }
101+ public static List < XMapLibKeymap > BuildPresetGaming ( )
102+ {
103+ List < XMapLibKeymap > mp = new ( )
104+ {
105+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_DOWN , VKMappedTo = ( int ) Keys . Down } ,
106+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_UP , VKMappedTo = ( int ) Keys . Up } ,
107+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_LEFT , VKMappedTo = ( int ) Keys . Left } ,
108+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_RIGHT , VKMappedTo = ( int ) Keys . Right } ,
109+ new ( ) { UsesRepeatBehavior = false , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTRIGGER , VKMappedTo = ( int ) Keys . RButton } ,
110+ new ( ) { UsesRepeatBehavior = false , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_RTRIGGER , VKMappedTo = ( int ) Keys . LButton } ,
111+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_UP , VKMappedTo = ( int ) Keys . W } ,
112+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_LEFT , VKMappedTo = ( int ) Keys . A } ,
113+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWN , VKMappedTo = ( int ) Keys . S } ,
114+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_RIGHT , VKMappedTo = ( int ) Keys . D } ,
115+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_UPLEFT , VKMappedTo = ( int ) Keys . W } ,
116+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_UPLEFT , VKMappedTo = ( int ) Keys . A } ,
117+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_UPRIGHT , VKMappedTo = ( int ) Keys . W } ,
118+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_UPRIGHT , VKMappedTo = ( int ) Keys . D } ,
119+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWNLEFT , VKMappedTo = ( int ) Keys . S } ,
120+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWNLEFT , VKMappedTo = ( int ) Keys . A } ,
121+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWNRIGHT , VKMappedTo = ( int ) Keys . S } ,
122+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWNRIGHT , VKMappedTo = ( int ) Keys . D } ,
123+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_A , VKMappedTo = ( int ) Keys . Space } ,
124+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_B , VKMappedTo = ( int ) Keys . F } ,
125+ new ( ) { UsesRepeatBehavior = false , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_Y , VKMappedTo = ( int ) Keys . G } ,
126+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_RTHUMB_PRESS , VKMappedTo = ( int ) Keys . C } ,
127+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_PRESS , VKMappedTo = ( int ) Keys . LShiftKey } ,
128+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_START , VKMappedTo = ( int ) Keys . Escape } ,
129+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LSHOULDER , VKMappedTo = ( int ) Keys . Q } ,
130+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_RSHOULDER , VKMappedTo = ( int ) Keys . E } ,
131+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_X , VKMappedTo = ( int ) Keys . R }
132+ } ;
133+ return mp ;
134+ }
135+ public static List < XMapLibKeymap > BuildPresetMovie ( )
136+ {
137+ List < XMapLibKeymap > mp = new ( )
138+ {
139+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_DOWN , VKMappedTo = ( int ) Keys . VolumeDown } ,
140+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_UP , VKMappedTo = ( int ) Keys . VolumeUp } ,
141+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_LEFT , VKMappedTo = ( int ) Keys . Left } ,
142+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_DPAD_RIGHT , VKMappedTo = ( int ) Keys . Right } ,
143+ new ( ) { UsesRepeatBehavior = false , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTRIGGER , VKMappedTo = ( int ) Keys . RButton } ,
144+ new ( ) { UsesRepeatBehavior = false , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_RTRIGGER , VKMappedTo = ( int ) Keys . LButton } ,
145+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_UP , VKMappedTo = ( int ) Keys . PageUp } ,
146+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_LEFT , VKMappedTo = ( int ) Keys . BrowserBack } ,
147+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_DOWN , VKMappedTo = ( int ) Keys . PageDown } ,
148+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LTHUMB_RIGHT , VKMappedTo = ( int ) Keys . BrowserForward } ,
149+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_LSHOULDER , VKMappedTo = ( int ) Keys . MediaPlayPause } ,
150+ new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_RSHOULDER , VKMappedTo = ( int ) Keys . VolumeMute } ,
94151 new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_A , VKMappedTo = ( int ) Keys . Space } ,
95152 new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_B , VKMappedTo = ( int ) Keys . E } ,
96153 new ( ) { UsesRepeatBehavior = true , VKMappedFrom = ( int ) ControllerButtons . VK_PAD_X , VKMappedTo = ( int ) Keys . R }
0 commit comments