Upside down / left handed orientation support (#2462)

* Add backup files to .gitignore
* Added lefty support in Settings > System > hand Orient: Fixes: #1015
* Left handed mode
* Fix lefthanded mode on vertical interfaces
* Input: new composite sequence identifier
* Gui: move input mapping from Canvas to ViewPort, properly handle input mapping on View switch in ViewDispatcher
* Rpc: proper input sequencing and tagging in RpcGui
* Rpc: remove magic from RpcGui

Co-authored-by: MrDaGree <5050898+MrDaGree@users.noreply.github.com>
Co-authored-by: Willy-JL <willy.leslie@icloud.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
This commit is contained in:
Michal Suchánek
2023-03-09 18:13:18 +01:00
committed by GitHub
parent 4fd043398a
commit 780da7d4d5
11 changed files with 133 additions and 48 deletions

View File

@@ -124,6 +124,23 @@ static void date_format_changed(VariableItem* item) {
locale_set_date_format(date_format_value[index]);
}
const char* const hand_mode[] = {
"Righty",
"Lefty",
};
static void hand_orient_changed(VariableItem* item) {
uint8_t index = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, hand_mode[index]);
if(index) {
furi_hal_rtc_set_flag(FuriHalRtcFlagHandOrient);
} else {
furi_hal_rtc_reset_flag(FuriHalRtcFlagHandOrient);
}
loader_update_menu();
}
static uint32_t system_settings_exit(void* context) {
UNUSED(context);
return VIEW_NONE;
@@ -145,6 +162,12 @@ SystemSettings* system_settings_alloc() {
uint8_t value_index;
app->var_item_list = variable_item_list_alloc();
item = variable_item_list_add(
app->var_item_list, "Hand Orient", COUNT_OF(hand_mode), hand_orient_changed, app);
value_index = furi_hal_rtc_is_flag_set(FuriHalRtcFlagHandOrient) ? 1 : 0;
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, hand_mode[value_index]);
item = variable_item_list_add(
app->var_item_list,
"Units",