mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-21 19:36:41 +00:00
make power and volume work even with the joycons connected (#85)
* hi einso * make power and volume work even with the joycons connected * fix keyboard with volume buttons --------- Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
This commit is contained in:
parent
917291374c
commit
91261f1671
3 changed files with 20 additions and 12 deletions
|
@ -51,16 +51,18 @@ For question specifically for TegraExplorer, go to [my discord](https://discord.
|
|||
Based on [Lockpick_RCM](https://github.com/shchmue/Lockpick_RCM), and thus also based on [Hekate](https://github.com/CTCaer/hekate)
|
||||
|
||||
Awesome people who helped with this project:
|
||||
- shchmue
|
||||
- Dennthecafebabe
|
||||
- [shchmue](https://github.com/shchmue)
|
||||
- [maddiethecafebabe](https://github.com/maddiethecafebabe/)
|
||||
- [bleck9999](https://github.com/bleck9999)
|
||||
|
||||
Other awesome people:
|
||||
- PhazonicRidley
|
||||
- Dax
|
||||
- Huhen
|
||||
- Bleck9999
|
||||
- Exelix
|
||||
- Emmo
|
||||
- Gengar
|
||||
- Einso
|
||||
- JeffV
|
||||
|
||||
## Screenshots
|
||||
|
|
|
@ -50,8 +50,8 @@ Input_t *hidRead(){
|
|||
LbaseY = controller->lstick_y;
|
||||
}
|
||||
|
||||
inputs.up = (controller->up || (controller->lstick_y > LbaseY + 500)) ? 1 : 0;
|
||||
inputs.down = (controller->down || (controller->lstick_y < LbaseY - 500)) ? 1 : 0;
|
||||
inputs.up = (controller->up || inputs.volp || (controller->lstick_y > LbaseY + 500)) ? 1 : 0;
|
||||
inputs.down = (controller->down || inputs.volm || (controller->lstick_y < LbaseY - 500)) ? 1 : 0;
|
||||
inputs.left = (controller->left || (controller->lstick_x < LbaseX - 500)) ? 1 : 0;
|
||||
inputs.right = (controller->right || (controller->lstick_x > LbaseX + 500)) ? 1 : 0;
|
||||
}
|
||||
|
@ -71,8 +71,7 @@ Input_t *hidRead(){
|
|||
inputs.rLeft = (controller->rstick_x < RbaseX - 500) ? 1 : 0;
|
||||
inputs.rRight = (controller->rstick_x > RbaseX + 500) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
inputs.a = inputs.power;
|
||||
inputs.a = inputs.a || inputs.power;
|
||||
|
||||
return &inputs;
|
||||
}
|
||||
|
@ -104,4 +103,4 @@ Input_t *hidWait(){
|
|||
bool hidConnected(){
|
||||
jc_gamepad_rpt_t *controller = joycon_poll();
|
||||
return (controller->conn_l && controller->conn_r) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,12 +157,19 @@ char *ShowKeyboard(const char *toEdit, u8 alwaysRet){
|
|||
}
|
||||
int val = (input->up || input->down) ? 11 : 1;
|
||||
|
||||
// Btn buttons do not work lol
|
||||
if (input->buttons & (JoyLLeft | JoyLUp | BtnVolM)){
|
||||
if (input->volm) {
|
||||
if (pos > 0)
|
||||
pos -= 1;
|
||||
}
|
||||
else if (input->volp) {
|
||||
if (pos < 43)
|
||||
pos += 1;
|
||||
}
|
||||
else if (input->buttons & (JoyLLeft | JoyLUp)){
|
||||
if (pos > -1 + val)
|
||||
pos -= val;
|
||||
}
|
||||
if (input->buttons & (JoyLRight | JoyLDown | BtnVolP)){
|
||||
else if (input->buttons & (JoyLRight | JoyLDown)){
|
||||
if (pos < 44 - val)
|
||||
pos += val;
|
||||
}
|
||||
|
@ -178,4 +185,4 @@ char *ShowKeyboard(const char *toEdit, u8 alwaysRet){
|
|||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue