mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-22 11:56:42 +00:00
add hidread function to script
This commit is contained in:
parent
b5f5701e58
commit
785549a9c8
1 changed files with 15 additions and 6 deletions
|
@ -234,13 +234,8 @@ char *powNames[] = {
|
||||||
"volminus",
|
"volminus",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Takes [int]. Returns dict[a,b,x,y,down,up,right,left,power,volplus,volminus,raw]. int: mask for hidWaitMask
|
Variable_t *hidToVar(u32 raw){
|
||||||
ClassFunction(stdPauseMask){
|
|
||||||
Variable_t ret = {.variableType = DictionaryClass, .dictionary.vector = newVec(sizeof(Dict_t), 9)};
|
Variable_t ret = {.variableType = DictionaryClass, .dictionary.vector = newVec(sizeof(Dict_t), 9)};
|
||||||
Input_t *i = hidWaitMask((u32)getIntValue(*args));
|
|
||||||
|
|
||||||
u32 raw = i->buttons;
|
|
||||||
|
|
||||||
addIntToDict(&ret, "raw", raw);
|
addIntToDict(&ret, "raw", raw);
|
||||||
|
|
||||||
for (int i = 0; i < ARRAY_SIZE(abxyNames); i++){
|
for (int i = 0; i < ARRAY_SIZE(abxyNames); i++){
|
||||||
|
@ -265,6 +260,19 @@ ClassFunction(stdPauseMask){
|
||||||
return copyVariableToPtr(ret);
|
return copyVariableToPtr(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClassFunction(stdRead){
|
||||||
|
Input_t *i = hidRead();
|
||||||
|
u32 raw = i->buttons;
|
||||||
|
return hidToVar(raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Takes [int]. Returns dict[a,b,x,y,down,up,right,left,power,volplus,volminus,raw]. int: mask for hidWaitMask
|
||||||
|
ClassFunction(stdPauseMask){
|
||||||
|
Input_t *i = hidWaitMask((u32)getIntValue(*args));
|
||||||
|
u32 raw = i->buttons;
|
||||||
|
return hidToVar(raw);
|
||||||
|
}
|
||||||
|
|
||||||
// Takes none. Returns dict (same as stdPauseMask).
|
// Takes none. Returns dict (same as stdPauseMask).
|
||||||
ClassFunction(stdPause){
|
ClassFunction(stdPause){
|
||||||
Variable_t a = {.integer.value = 0xFFFFFFFF};
|
Variable_t a = {.integer.value = 0xFFFFFFFF};
|
||||||
|
@ -541,6 +549,7 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
|
||||||
{"timer", stdGetMs, 0, 0},
|
{"timer", stdGetMs, 0, 0},
|
||||||
{"pause", stdPauseMask, 1, threeIntsStd},
|
{"pause", stdPauseMask, 1, threeIntsStd},
|
||||||
{"pause", stdPause, 0, 0},
|
{"pause", stdPause, 0, 0},
|
||||||
|
{"hidread", stdRead, 0, 0},
|
||||||
{"color", stdColor, 1, threeIntsStd},
|
{"color", stdColor, 1, threeIntsStd},
|
||||||
{"menu", stdMenuFull, 3, menuArgsStd},
|
{"menu", stdMenuFull, 3, menuArgsStd},
|
||||||
{"menu", stdMenuFull, 2, menuArgsStd},
|
{"menu", stdMenuFull, 2, menuArgsStd},
|
||||||
|
|
Loading…
Reference in a new issue