Joker button: Difference between revisions

From MIB-Helper.com Wiki
Jump to navigation Jump to search
Created page with " private boolean isNaviFunctionSet() { int n = this.getApplication().getFrameworkAccess().getStorageMgr().getInt(1006, 10, -1); return n == 3 || n == 4 || n == 5 || n == 10 || n == 11; } public void writePersistentViewOptionState(PersistentMenuEntry persistentMenuEntry, int n) { if (this.storageAccess != null) { this.storageAccess.setInt(1006, this.persistenceKey, n); } }"
 
No edit summary
 
Line 1: Line 1:
The asterix button on the steering wheel.
=== Joker button Navigation functions ===
This checks if Joker button is set to one of the navigation-related functions. This is stored in [[Persistence#1006|Persistance namespace 1006, key 10]].
   private boolean isNaviFunctionSet() {
   private boolean isNaviFunctionSet() {
         int n = this.getApplication().getFrameworkAccess().getStorageMgr().getInt(1006, 10, -1);
         int n = this.getApplication().getFrameworkAccess().getStorageMgr().getInt(1006, 10, -1);
Line 4: Line 9:
     }
     }


=== Joker button storing function ===
This is called to store selected option to the persistence namespace 1006. Storing Joker option will use <code> this.persistenceKey = 10;</code> as 10 is the key for Joker function.


     public void writePersistentViewOptionState(PersistentMenuEntry persistentMenuEntry, int n) {
     public void writePersistentViewOptionState(PersistentMenuEntry persistentMenuEntry, int n) {
Line 10: Line 17:
         }
         }
     }
     }
=== Joker button Long Press ===
This function is responsible for opening popup window with Joker function option. This menu normally can be accessed from the CAR menu. But over here we can see that it's also called if the Joker button is long-pressed.
    protected void handleJokerKeyLongpress() {
        this.getLogChannel().log(-2137614336, "[JokerKeyComponentEvo#handleJokerKeyLongPress] show joker key popup");
        this.getApplication().getFrameworkAccess().getHmiServiceApp().showPopup(-953743104);
Potentially we could remap the long-press action of this button if changing the <code>showPopup(-953743104)</code> to something else.
[[Category:Software]]
[[Category:Research]]
[[Category:Tweaks]]

Latest revision as of 10:59, 19 January 2025

The asterix button on the steering wheel.

Joker button Navigation functions

This checks if Joker button is set to one of the navigation-related functions. This is stored in Persistance namespace 1006, key 10.

  private boolean isNaviFunctionSet() {
       int n = this.getApplication().getFrameworkAccess().getStorageMgr().getInt(1006, 10, -1);
       return n == 3 || n == 4 || n == 5 || n == 10 || n == 11;
   }

Joker button storing function

This is called to store selected option to the persistence namespace 1006. Storing Joker option will use this.persistenceKey = 10; as 10 is the key for Joker function.

   public void writePersistentViewOptionState(PersistentMenuEntry persistentMenuEntry, int n) {
       if (this.storageAccess != null) {
           this.storageAccess.setInt(1006, this.persistenceKey, n);
       }
   }

Joker button Long Press

This function is responsible for opening popup window with Joker function option. This menu normally can be accessed from the CAR menu. But over here we can see that it's also called if the Joker button is long-pressed.

   protected void handleJokerKeyLongpress() {
       this.getLogChannel().log(-2137614336, "[JokerKeyComponentEvo#handleJokerKeyLongPress] show joker key popup");
       this.getApplication().getFrameworkAccess().getHmiServiceApp().showPopup(-953743104);

Potentially we could remap the long-press action of this button if changing the showPopup(-953743104) to something else.