mirror of
https://github.com/opentx/opentx.git
synced 2025-07-16 04:45:17 +03:00
[Horus] Keymap is now consistent with labels on keys
This commit is contained in:
parent
9a66da21d5
commit
7e45537402
15 changed files with 99 additions and 152 deletions
|
@ -205,9 +205,10 @@ bool menuModelCurveOne(evt_t event)
|
||||||
popupMenuHandler = onCurveOneMenu;
|
popupMenuHandler = onCurveOneMenu;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVT_KEY_LONG(KEY_MENU):
|
// TODO?
|
||||||
pushMenu(menuChannelsView);
|
// case EVT_KEY_LONG(KEY_MENU):
|
||||||
killEvents(event);
|
// pushMenu(menuChannelsView);
|
||||||
|
// killEvents(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawCurve(CURVE_CENTER_X, CURVE_CENTER_Y, CURVE_SIDE_WIDTH);
|
drawCurve(CURVE_CENTER_X, CURVE_CENTER_Y, CURVE_SIDE_WIDTH);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../../opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
void displayFlightModes(coord_t x, coord_t y, FlightModesType value, uint8_t attr)
|
void displayFlightModes(coord_t x, coord_t y, FlightModesType value, uint8_t attr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../../opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
#define EXPO_ONE_2ND_COLUMN 110
|
#define EXPO_ONE_2ND_COLUMN 110
|
||||||
|
|
||||||
|
@ -450,41 +450,27 @@ bool menuModelExposAll(evt_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVT_KEY_LONG(KEY_LEFT):
|
|
||||||
case EVT_KEY_LONG(KEY_RIGHT):
|
case EVT_ROTARY_LEFT:
|
||||||
if (s_copyMode && !s_copyTgtOfs) {
|
case EVT_ROTARY_RIGHT:
|
||||||
if (reachExposLimit()) break;
|
|
||||||
s_currCh = chn;
|
|
||||||
if (event == EVT_KEY_LONG(KEY_RIGHT)) { s_currIdx++; menuVerticalPosition++; }
|
|
||||||
insertExpo(s_currIdx);
|
|
||||||
pushMenu(menuModelExpoOne);
|
|
||||||
s_copyMode = 0;
|
|
||||||
killEvents(event);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EVT_KEY_FIRST(KEY_UP):
|
|
||||||
case EVT_KEY_REPT(KEY_UP):
|
|
||||||
case EVT_KEY_FIRST(KEY_DOWN):
|
|
||||||
case EVT_KEY_REPT(KEY_DOWN):
|
|
||||||
if (s_copyMode) {
|
if (s_copyMode) {
|
||||||
uint8_t key = (event & 0x1f);
|
uint8_t next_ofs = ((event==EVT_ROTARY_LEFT) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||||
uint8_t next_ofs = ((event==EVT_ROTARY_LEFT || key==KEY_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
|
||||||
|
|
||||||
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
||||||
// insert a mix on the same channel (just above / just below)
|
// insert a mix on the same channel (just above / just below)
|
||||||
if (reachExposLimit()) break;
|
if (reachExposLimit()) break;
|
||||||
copyExpo(s_currIdx);
|
copyExpo(s_currIdx);
|
||||||
if (event==EVT_ROTARY_RIGHT || key==KEY_DOWN) s_currIdx++;
|
if (event==EVT_ROTARY_RIGHT) s_currIdx++;
|
||||||
else if (sub-menuVerticalOffset >= 6) menuVerticalOffset++;
|
else if (sub-menuVerticalOffset >= 6) menuVerticalOffset++;
|
||||||
}
|
}
|
||||||
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
||||||
// delete the mix
|
// delete the mix
|
||||||
deleteExpo(s_currIdx);
|
deleteExpo(s_currIdx);
|
||||||
if (event==EVT_ROTARY_LEFT || key==KEY_UP) s_currIdx--;
|
if (event==EVT_ROTARY_LEFT) s_currIdx--;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// only swap the mix with its neighbor
|
// only swap the mix with its neighbor
|
||||||
if (!swapExpos(s_currIdx, event==EVT_ROTARY_LEFT || key==KEY_UP)) break;
|
if (!swapExpos(s_currIdx, event==EVT_ROTARY_LEFT)) break;
|
||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
bool isThrottleOutput(uint8_t ch)
|
bool isThrottleOutput(uint8_t ch)
|
||||||
{
|
{
|
||||||
|
@ -176,10 +176,12 @@ bool menuModelLimits(evt_t event)
|
||||||
if (active) {
|
if (active) {
|
||||||
ld->offset = checkIncDec(event, ld->offset, -1000, 1000, EE_MODEL, NULL, stops1000);
|
ld->offset = checkIncDec(event, ld->offset, -1000, 1000, EE_MODEL, NULL, stops1000);
|
||||||
}
|
}
|
||||||
else if (attr && event==EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
copySticksToOffset(k);
|
// TODO with the contextual menu I think
|
||||||
s_editMode = 0;
|
// else if (attr && event==EVT_KEY_LONG(KEY_MENU)) {
|
||||||
}
|
// copySticksToOffset(k);
|
||||||
|
// s_editMode = 0;
|
||||||
|
// }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_LIMITS_MIN:
|
case ITEM_LIMITS_MIN:
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../opentx.h"
|
#include "opentx.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int getMixesLinesCount()
|
int getMixesLinesCount()
|
||||||
|
@ -421,41 +421,27 @@ bool menuModelMixAll(evt_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVT_KEY_LONG(KEY_LEFT):
|
|
||||||
case EVT_KEY_LONG(KEY_RIGHT):
|
case EVT_ROTARY_RIGHT:
|
||||||
if (s_copyMode && !s_copyTgtOfs) {
|
case EVT_ROTARY_LEFT:
|
||||||
if (reachMixesLimit()) break;
|
|
||||||
s_currCh = chn;
|
|
||||||
if (event == EVT_KEY_LONG(KEY_RIGHT)) { s_currIdx++; menuVerticalPosition++; }
|
|
||||||
insertMix(s_currIdx);
|
|
||||||
pushMenu(menuModelMixOne);
|
|
||||||
s_copyMode = 0;
|
|
||||||
killEvents(event);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EVT_KEY_FIRST(KEY_UP):
|
|
||||||
case EVT_KEY_REPT(KEY_UP):
|
|
||||||
case EVT_KEY_FIRST(KEY_DOWN):
|
|
||||||
case EVT_KEY_REPT(KEY_DOWN):
|
|
||||||
if (s_copyMode) {
|
if (s_copyMode) {
|
||||||
uint8_t key = (event & 0x1f);
|
uint8_t next_ofs = (event==EVT_ROTARY_LEFT ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||||
uint8_t next_ofs = ((event==EVT_ROTARY_LEFT || key==KEY_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
|
||||||
|
|
||||||
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
||||||
// insert a mix on the same channel (just above / just below)
|
// insert a mix on the same channel (just above / just below)
|
||||||
if (reachMixesLimit()) break;
|
if (reachMixesLimit()) break;
|
||||||
copyMix(s_currIdx);
|
copyMix(s_currIdx);
|
||||||
if (event==EVT_ROTARY_RIGHT || key==KEY_DOWN) s_currIdx++;
|
if (event==EVT_ROTARY_RIGHT) s_currIdx++;
|
||||||
else if (sub-menuVerticalOffset >= 6) menuVerticalOffset++;
|
else if (sub-menuVerticalOffset >= 6) menuVerticalOffset++;
|
||||||
}
|
}
|
||||||
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
||||||
// delete the mix
|
// delete the mix
|
||||||
deleteMix(s_currIdx);
|
deleteMix(s_currIdx);
|
||||||
if (event==EVT_ROTARY_LEFT || key==KEY_UP) s_currIdx--;
|
if (event==EVT_ROTARY_LEFT) s_currIdx--;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// only swap the mix with its neighbor
|
// only swap the mix with its neighbor
|
||||||
if (!swapMixes(s_currIdx, event==EVT_ROTARY_LEFT || key==KEY_UP)) break;
|
if (!swapMixes(s_currIdx, event==EVT_ROTARY_LEFT)) break;
|
||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
int menuVerticalOffset;
|
int menuVerticalOffset;
|
||||||
int menuVerticalPosition;
|
int menuVerticalPosition;
|
||||||
|
@ -411,32 +411,33 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
||||||
{
|
{
|
||||||
uint8_t maxcol = MAXCOL(menuVerticalPosition);
|
uint8_t maxcol = MAXCOL(menuVerticalPosition);
|
||||||
|
|
||||||
if (menuTab && !calibrationState && menuVerticalPosition<0) {
|
if (menuTab && !calibrationState) {
|
||||||
int cc = curr;
|
int cc = curr;
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
|
||||||
case EVT_ROTARY_RIGHT:
|
case EVT_ROTARY_RIGHT:
|
||||||
|
if (menuVerticalPosition >= 0)
|
||||||
|
break;
|
||||||
|
// no break
|
||||||
|
case EVT_KEY_BREAK(KEY_PGDN):
|
||||||
if (++cc == menuTabSize)
|
if (++cc == menuTabSize)
|
||||||
cc = 0;
|
cc = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_LEFT):
|
|
||||||
case EVT_ROTARY_LEFT:
|
case EVT_ROTARY_LEFT:
|
||||||
|
if (menuVerticalPosition >= 0)
|
||||||
|
break;
|
||||||
|
// no break
|
||||||
|
case EVT_KEY_BREAK(KEY_PGUP):
|
||||||
if (cc-- == 0)
|
if (cc-- == 0)
|
||||||
cc = menuTabSize-1;
|
cc = menuTabSize-1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_ENTER):
|
case EVT_KEY_BREAK(KEY_ENTER):
|
||||||
if (rowcount > 0) {
|
if (menuVerticalPosition < 0 && rowcount > 0) {
|
||||||
menuVerticalPosition = MENU_FIRST_LINE_EDIT;
|
menuVerticalPosition = MENU_FIRST_LINE_EDIT;
|
||||||
event = 0;
|
event = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_DOWN):
|
|
||||||
case EVT_KEY_BREAK(KEY_UP):
|
|
||||||
menuHorizontalPosition = -1;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc != curr) {
|
if (cc != curr) {
|
||||||
|
@ -537,24 +538,6 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
||||||
menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition);
|
menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_FIRST(KEY_DOWN):
|
|
||||||
case EVT_KEY_REPT(KEY_DOWN):
|
|
||||||
{
|
|
||||||
do {
|
|
||||||
INC(menuVerticalPosition, MENU_FIRST_LINE_EDIT, rowcount-1);
|
|
||||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(menuVerticalPosition));
|
|
||||||
|
|
||||||
s_editMode = 0; // if we go down, we must be in this mode
|
|
||||||
uint8_t newmaxcol = MAXCOL(menuVerticalPosition);
|
|
||||||
if (COLATTR(menuVerticalPosition) & NAVIGATION_LINE_BY_LINE) {
|
|
||||||
menuHorizontalPosition = -1;
|
|
||||||
}
|
|
||||||
else if (menuHorizontalPosition < 0 || menuHorizontalPosition > newmaxcol) {
|
|
||||||
menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case EVT_ROTARY_LEFT:
|
case EVT_ROTARY_LEFT:
|
||||||
if (s_editMode != 0) break;
|
if (s_editMode != 0) break;
|
||||||
if ((COLATTR(menuVerticalPosition) & NAVIGATION_LINE_BY_LINE)) {
|
if ((COLATTR(menuVerticalPosition) & NAVIGATION_LINE_BY_LINE)) {
|
||||||
|
@ -575,26 +558,6 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
||||||
else
|
else
|
||||||
menuHorizontalPosition = MAXCOL(menuVerticalPosition);
|
menuHorizontalPosition = MAXCOL(menuVerticalPosition);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_FIRST(KEY_UP):
|
|
||||||
case EVT_KEY_REPT(KEY_UP):
|
|
||||||
{
|
|
||||||
do {
|
|
||||||
DEC(menuVerticalPosition, MENU_FIRST_LINE_EDIT, rowcount-1);
|
|
||||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(menuVerticalPosition));
|
|
||||||
s_editMode = 0; // if we go up, we must be in this mode
|
|
||||||
uint8_t newmaxcol = MAXCOL(menuVerticalPosition);
|
|
||||||
if ((COLATTR(menuVerticalPosition) & NAVIGATION_LINE_BY_LINE)) {
|
|
||||||
menuHorizontalPosition = -1;
|
|
||||||
}
|
|
||||||
else if (menuHorizontalPosition < 0) {
|
|
||||||
menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition);
|
|
||||||
}
|
|
||||||
else if (menuHorizontalPosition > newmaxcol) {
|
|
||||||
menuHorizontalPosition = min((uint8_t)menuHorizontalPosition, newmaxcol);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
linesCount = rowcount;
|
linesCount = rowcount;
|
||||||
|
|
|
@ -107,8 +107,6 @@ const char * displayPopupMenu(evt_t event)
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case EVT_ROTARY_LEFT:
|
case EVT_ROTARY_LEFT:
|
||||||
case EVT_KEY_FIRST(KEY_UP):
|
|
||||||
case EVT_KEY_REPT(KEY_UP):
|
|
||||||
if (s_menu_item > 0) {
|
if (s_menu_item > 0) {
|
||||||
s_menu_item--;
|
s_menu_item--;
|
||||||
}
|
}
|
||||||
|
@ -126,8 +124,6 @@ const char * displayPopupMenu(evt_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_ROTARY_RIGHT:
|
case EVT_ROTARY_RIGHT:
|
||||||
case EVT_KEY_FIRST(KEY_DOWN):
|
|
||||||
case EVT_KEY_REPT(KEY_DOWN):
|
|
||||||
if (s_menu_item < display_count - 1 && popupMenuOffset + s_menu_item + 1 < popupMenuNoItems) {
|
if (s_menu_item < display_count - 1 && popupMenuOffset + s_menu_item + 1 < popupMenuNoItems) {
|
||||||
s_menu_item++;
|
s_menu_item++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,11 +49,11 @@ bool menuAboutView(evt_t event)
|
||||||
screenIndex = 0;
|
screenIndex = 0;
|
||||||
greyIndex = 0;
|
greyIndex = 0;
|
||||||
break;
|
break;
|
||||||
case EVT_KEY_FIRST(KEY_DOWN):
|
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||||
screenIndex < ABOUT_PARENTS ? screenIndex++ : screenIndex = ABOUT_OPENTX;
|
screenIndex < ABOUT_PARENTS ? screenIndex++ : screenIndex = ABOUT_OPENTX;
|
||||||
greyIndex = 0;
|
greyIndex = 0;
|
||||||
break;
|
break;
|
||||||
case EVT_KEY_FIRST(KEY_UP):
|
case EVT_KEY_FIRST(KEY_LEFT):
|
||||||
screenIndex > ABOUT_OPENTX ? screenIndex-- : screenIndex = ABOUT_PARENTS;
|
screenIndex > ABOUT_OPENTX ? screenIndex-- : screenIndex = ABOUT_PARENTS;
|
||||||
greyIndex = 0;
|
greyIndex = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -154,21 +154,21 @@ bool menuMainView(evt_t event)
|
||||||
popupMenuHandler = onMainViewMenu;
|
popupMenuHandler = onMainViewMenu;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_MENU):
|
case EVT_KEY_BREAK(KEY_MODEL):
|
||||||
pushMenu(menuTabModel[0]);
|
pushMenu(menuTabModel[0]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_LONG(KEY_MENU):
|
case EVT_KEY_BREAK(KEY_RADIO):
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
pushMenu(menuTabGeneral[0]);
|
pushMenu(menuTabGeneral[0]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_DOWN):
|
case EVT_KEY_BREAK(KEY_PGDN):
|
||||||
storageDirty(EE_GENERAL);
|
storageDirty(EE_GENERAL);
|
||||||
g_eeGeneral.view = circularIncDec(g_eeGeneral.view, +1, 0, getMainViewsCount()-1);
|
g_eeGeneral.view = circularIncDec(g_eeGeneral.view, +1, 0, getMainViewsCount()-1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_UP):
|
case EVT_KEY_BREAK(KEY_PGUP):
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
storageDirty(EE_GENERAL);
|
storageDirty(EE_GENERAL);
|
||||||
g_eeGeneral.view = circularIncDec(g_eeGeneral.view, -1, 0, getMainViewsCount()-1);
|
g_eeGeneral.view = circularIncDec(g_eeGeneral.view, -1, 0, getMainViewsCount()-1);
|
||||||
|
|
|
@ -1,35 +1,39 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) OpenTX
|
* Copyright (C) OpenTX
|
||||||
*
|
*
|
||||||
* Based on code named
|
* Based on code named
|
||||||
* th9x - http://code.google.com/p/th9x
|
* th9x - http://code.google.com/p/th9x
|
||||||
* er9x - http://code.google.com/p/er9x
|
* er9x - http://code.google.com/p/er9x
|
||||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||||
*
|
*
|
||||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _KEYS_H_
|
#ifndef _KEYS_H_
|
||||||
#define _KEYS_H_
|
#define _KEYS_H_
|
||||||
|
|
||||||
enum EnumKeys {
|
enum EnumKeys {
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBHORUS)
|
||||||
KEY_MENU,
|
KEY_PGUP,
|
||||||
KEY_EXIT,
|
KEY_PGDN,
|
||||||
KEY_ENTER,
|
KEY_ENTER,
|
||||||
KEY_UP,
|
KEY_MODEL,
|
||||||
KEY_DOWN,
|
KEY_UP=KEY_MODEL,
|
||||||
KEY_RIGHT,
|
KEY_EXIT,
|
||||||
KEY_LEFT,
|
KEY_DOWN=KEY_EXIT,
|
||||||
|
KEY_TELEM,
|
||||||
|
KEY_RIGHT=KEY_TELEM,
|
||||||
|
KEY_RADIO,
|
||||||
|
KEY_LEFT=KEY_RADIO,
|
||||||
#elif defined(PCBFLAMENCO)
|
#elif defined(PCBFLAMENCO)
|
||||||
KEY_MENU,
|
KEY_MENU,
|
||||||
KEY_EXIT,
|
KEY_EXIT,
|
||||||
|
@ -273,4 +277,4 @@ void killEvents(uint8_t enuk);
|
||||||
|
|
||||||
uint8_t keyDown();
|
uint8_t keyDown();
|
||||||
|
|
||||||
#endif // _KEYS_H_
|
#endif // _KEYS_H_
|
||||||
|
|
|
@ -863,7 +863,9 @@ const luaR_value_entry opentxConstants[] = {
|
||||||
{ "MIXSRC_SH", MIXSRC_SH },
|
{ "MIXSRC_SH", MIXSRC_SH },
|
||||||
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
||||||
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
||||||
|
#if !defined(PCBHORUS)
|
||||||
{ "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) },
|
{ "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) },
|
||||||
|
#endif
|
||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
{ "COLOR", ZoneOption::Color },
|
{ "COLOR", ZoneOption::Color },
|
||||||
{ "TEXT_COLOR_INDEX", TEXT_COLOR_INDEX },
|
{ "TEXT_COLOR_INDEX", TEXT_COLOR_INDEX },
|
||||||
|
|
|
@ -588,10 +588,13 @@ void luaDoOneRunStandalone(evt_t evt)
|
||||||
standaloneScript.state = SCRIPT_NOFILE;
|
standaloneScript.state = SCRIPT_NOFILE;
|
||||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||||
}
|
}
|
||||||
|
#if !defined(PCBHORUS)
|
||||||
|
// TODO find another key and add a #define
|
||||||
else if (evt == EVT_KEY_LONG(KEY_MENU)) {
|
else if (evt == EVT_KEY_LONG(KEY_MENU)) {
|
||||||
killEvents(evt);
|
killEvents(evt);
|
||||||
luaDisplayStatistics = !luaDisplayStatistics;
|
luaDisplayStatistics = !luaDisplayStatistics;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,9 +229,9 @@ void Open9xSim::updateKeysAndSwitches(bool start)
|
||||||
{
|
{
|
||||||
static int keys1[] = {
|
static int keys1[] = {
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBHORUS)
|
||||||
KEY_Page_Up, KEY_MENU,
|
KEY_Page_Up, KEY_PGUP,
|
||||||
|
KEY_Page_Down, KEY_PGDN,
|
||||||
KEY_Return, KEY_ENTER,
|
KEY_Return, KEY_ENTER,
|
||||||
KEY_BackSpace, KEY_EXIT,
|
|
||||||
KEY_Up, KEY_UP,
|
KEY_Up, KEY_UP,
|
||||||
KEY_Down, KEY_DOWN,
|
KEY_Down, KEY_DOWN,
|
||||||
KEY_Right, KEY_RIGHT,
|
KEY_Right, KEY_RIGHT,
|
||||||
|
|
|
@ -25,19 +25,19 @@ uint32_t readKeys()
|
||||||
uint32_t result = 0;
|
uint32_t result = 0;
|
||||||
|
|
||||||
if (~KEYS_GPIO_REG_MENU & KEYS_GPIO_PIN_MENU)
|
if (~KEYS_GPIO_REG_MENU & KEYS_GPIO_PIN_MENU)
|
||||||
result |= 1 << KEY_MENU;
|
result |= 1 << KEY_PGUP;
|
||||||
if (~KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT)
|
if (~KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT)
|
||||||
result |= 1 << KEY_EXIT;
|
result |= 1 << KEY_PGDN;
|
||||||
if (~KEYS_GPIO_REG_ENTER & KEYS_GPIO_PIN_ENTER)
|
if (~KEYS_GPIO_REG_ENTER & KEYS_GPIO_PIN_ENTER)
|
||||||
result |= 1 << KEY_ENTER;
|
result |= 1 << KEY_ENTER;
|
||||||
if (~KEYS_GPIO_REG_UP & KEYS_GPIO_PIN_UP)
|
if (~KEYS_GPIO_REG_UP & KEYS_GPIO_PIN_UP)
|
||||||
result |= 1 << KEY_UP;
|
result |= 1 << KEY_MODEL;
|
||||||
if (~KEYS_GPIO_REG_DOWN & KEYS_GPIO_PIN_DOWN)
|
if (~KEYS_GPIO_REG_DOWN & KEYS_GPIO_PIN_DOWN)
|
||||||
result |= 1 << KEY_DOWN;
|
result |= 1 << KEY_EXIT;
|
||||||
if (~KEYS_GPIO_REG_RIGHT & KEYS_GPIO_PIN_RIGHT)
|
if (~KEYS_GPIO_REG_RIGHT & KEYS_GPIO_PIN_RIGHT)
|
||||||
result |= 1 << KEY_RIGHT;
|
result |= 1 << KEY_TELEM;
|
||||||
if (~KEYS_GPIO_REG_LEFT & KEYS_GPIO_PIN_LEFT)
|
if (~KEYS_GPIO_REG_LEFT & KEYS_GPIO_PIN_LEFT)
|
||||||
result |= 1 << KEY_LEFT;
|
result |= 1 << KEY_RADIO;
|
||||||
|
|
||||||
// TRACE("readKeys(): %x", result);
|
// TRACE("readKeys(): %x", result);
|
||||||
|
|
||||||
|
|
|
@ -165,14 +165,18 @@ void simuSetKey(uint8_t key, bool state)
|
||||||
{
|
{
|
||||||
// TRACE("simuSetKey(%d, %d)", key, state);
|
// TRACE("simuSetKey(%d, %d)", key, state);
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
#if !defined(PCBHORUS)
|
||||||
KEY_CASE(KEY_MENU, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
|
KEY_CASE(KEY_MENU, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
|
||||||
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
|
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
|
||||||
|
#endif
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBHORUS)
|
||||||
|
KEY_CASE(KEY_PGUP, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
|
||||||
|
KEY_CASE(KEY_PGDN, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
|
||||||
KEY_CASE(KEY_ENTER, KEYS_GPIO_REG_ENTER, KEYS_GPIO_PIN_ENTER)
|
KEY_CASE(KEY_ENTER, KEYS_GPIO_REG_ENTER, KEYS_GPIO_PIN_ENTER)
|
||||||
KEY_CASE(KEY_RIGHT, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT)
|
KEY_CASE(KEY_TELEM, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT)
|
||||||
KEY_CASE(KEY_LEFT, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)
|
KEY_CASE(KEY_RADIO, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)
|
||||||
KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
|
KEY_CASE(KEY_MODEL, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
|
||||||
KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
|
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
|
||||||
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
|
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
|
||||||
KEY_CASE(KEY_ENTER, KEYS_GPIO_REG_ENTER, KEYS_GPIO_PIN_ENTER)
|
KEY_CASE(KEY_ENTER, KEYS_GPIO_REG_ENTER, KEYS_GPIO_PIN_ENTER)
|
||||||
KEY_CASE(KEY_PAGE, KEYS_GPIO_REG_PAGE, KEYS_GPIO_PIN_PAGE)
|
KEY_CASE(KEY_PAGE, KEYS_GPIO_REG_PAGE, KEYS_GPIO_PIN_PAGE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue