File tree 2 files changed +26
-0
lines changed
driveRoot/rvloader/theme/scripts
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 359
359
function buttonsTester :handleInputs (onFocus )
360
360
local held = Pad .genheld (0 )
361
361
362
+ if held .BUTTON_A and held .BUTTON_B then
363
+ Pad .setRumble (0 , true )
364
+ end else
365
+ Pad .setRumble (0 , false )
366
+ end
367
+
362
368
if held .TRIGGER_R and held .TRIGGER_L then
363
369
self .controllerSettings .runningButtonsTester = false
370
+ Pad .setRumble (0 , false )
364
371
end
365
372
end
366
373
Original file line number Diff line number Diff line change @@ -223,6 +223,24 @@ static int lua_Pad_triggers(lua_State* L) {
223
223
return 1 ;
224
224
}
225
225
226
+ static int lua_Pad_setRumble (lua_State* L) {
227
+ int argc = lua_gettop (L);
228
+ if (argc != 2 ) {
229
+ return luaL_error (L, " wrong number of arguments" );
230
+ }
231
+
232
+ u32 channel = luaL_checkinteger (L, 1 );
233
+ if (channel > 3 ) {
234
+ return luaL_error (L, " pad channel must be 0-3" );
235
+ }
236
+
237
+ bool rumbleState = lua_toboolean (L, 2 );
238
+
239
+ PAD_ControlMotor (channel, rumbleState ? 1 : 0 );
240
+
241
+ return 0 ;
242
+ }
243
+
226
244
static const luaL_Reg Pad_functions[] = {
227
245
{" isConnected" , lua_Pad_isConnected},
228
246
{" held" , lua_Pad_held},
@@ -236,6 +254,7 @@ static const luaL_Reg Pad_functions[] = {
236
254
{" genstick" , lua_Pad_genstick},
237
255
{" gensubStick" , lua_Pad_gensubStick},
238
256
{" triggers" , lua_Pad_triggers},
257
+ {" setRumble" , lua_Pad_setRumble},
239
258
{NULL , NULL }
240
259
};
241
260
You can’t perform that action at this time.
0 commit comments