Fixed the button mapping issue so that they can be 1 indexed when specifying in options.txt

This commit is contained in:
Stephen White 2018-09-30 22:42:56 +10:00
parent 1a3941913e
commit a249bf295f
2 changed files with 10 additions and 10 deletions

View File

@ -149,11 +149,11 @@ Options::Options(void)
, i2cLcdModel(LCD_UNKNOWN) , i2cLcdModel(LCD_UNKNOWN)
, scrollHighlightRate(0.125f) , scrollHighlightRate(0.125f)
, keyboardBrowseLCDScreen(0) , keyboardBrowseLCDScreen(0)
, buttonEnter(0) , buttonEnter(1)
, buttonUp(1) , buttonUp(2)
, buttonDown(2) , buttonDown(3)
, buttonBack(3) , buttonBack(4)
, buttonInsert(4) , buttonInsert(5)
{ {
autoMountImageName[0] = 0; autoMountImageName[0] = 0;

View File

@ -89,11 +89,11 @@ public:
inline float ScrollHighlightRate() const { return scrollHighlightRate; } inline float ScrollHighlightRate() const { return scrollHighlightRate; }
inline unsigned int GetButtonEnter() const { return buttonEnter; } inline unsigned int GetButtonEnter() const { return buttonEnter - 1; }
inline unsigned int GetButtonUp() const { return buttonUp; } inline unsigned int GetButtonUp() const { return buttonUp - 1; }
inline unsigned int GetButtonDown() const { return buttonDown; } inline unsigned int GetButtonDown() const { return buttonDown - 1; }
inline unsigned int GetButtonBack() const { return buttonBack; } inline unsigned int GetButtonBack() const { return buttonBack - 1; }
inline unsigned int GetButtonInsert() const { return buttonInsert; } inline unsigned int GetButtonInsert() const { return buttonInsert - 1; }
// Page up and down will jump a different amount based on the maximum number rows displayed. // Page up and down will jump a different amount based on the maximum number rows displayed.
// Perhaps we should use some keyboard modifier to the the other screen? // Perhaps we should use some keyboard modifier to the the other screen?