diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..cea4d3f --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2f014ea --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": true, + "cwd": ".", + "program": "build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3e5eb95 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false +} \ No newline at end of file diff --git a/FabiWare/FabiWare.ino b/FabiWare/FabiWare.ino index 2c6bd12..064c4dd 100644 --- a/FabiWare/FabiWare.ino +++ b/FabiWare/FabiWare.ino @@ -37,54 +37,56 @@ */ #include "FlipWare.h" -#include "gpio.h" -#include "sensors.h" -#include "infrared.h" -#include "display.h" // for SSD1306 I2C-Oled display +#include "gpio.h" +#include "sensors.h" +#include "infrared.h" +#include "display.h" // for SSD1306 I2C-Oled display #include "modes.h" #include "tone.h" -#include "parser.h" +#include "parser.h" #include "reporting.h" #include "keys.h" #include - /** device name for ID string & BT-pairing */ -char moduleName[]="FABI"; +char moduleName[] = "FABI"; /** default values for empty configuration slot */ -const struct SlotSettings defaultSlotSettings = { // default slotSettings valus, for type definition see Flipware.h - "keys", // initial slot name - 0, // initial keystringbuffer length - 400, 600, 3, // threshold sip, threshold puff, wheel step, - 800, 10, // threshold strong puff, threshold strong sip - 1, // bt-mode 1: USB, 2: Bluetooth, 3: both (2 & 3 need daughter board)) - 0x0000FF, // default slot color: blue - "en_US", // en_US as default keyboard layout. +const struct SlotSettings defaultSlotSettings = { + // default slotSettings valus, for type definition see Flipware.h + "keys", // initial slot name + 0, // initial keystringbuffer length + 400, 600, 3, // threshold sip, threshold puff, wheel step, + 800, 10, // threshold strong puff, threshold strong sip + 1, // bt-mode 1: USB, 2: Bluetooth, 3: both (2 & 3 need daughter board)) + 0x0000FF, // default slot color: blue + "en_US", // en_US as default keyboard layout. + 500, // Threshold for long button press. + 200, // Threshold/time for double press for slot change. }; /** static variables and data structures for settings and sensor data management */ -struct SensorData sensorData { - .pressure=0, +struct SensorData sensorData { + .pressure = 0, }; -struct I2CSensorValues sensorValues { - .pressure=512, - .calib_now=CALIBRATION_PERIOD // calibrate sensors after startup ! +struct I2CSensorValues sensorValues { + .pressure = 512, + .calib_now = CALIBRATION_PERIOD // calibrate sensors after startup ! }; -struct SlotSettings slotSettings; // contains all slot settings -uint8_t workingmem[WORKINGMEM_SIZE]; // working memory (command parser, IR-rec/play) -uint8_t actSlot = 0; // number of current slot -unsigned long lastInteractionUpdate; // timestamp for HID interaction updates +struct SlotSettings slotSettings; // contains all slot settings +uint8_t workingmem[WORKINGMEM_SIZE]; // working memory (command parser, IR-rec/play) +uint8_t actSlot = 0; // number of current slot +unsigned long lastInteractionUpdate; // timestamp for HID interaction updates /** @@ -98,41 +100,41 @@ void setup() { mutex_init(&(sensorValues.sensorDataMutex)); //load slotSettings - memcpy(&slotSettings,&defaultSlotSettings,sizeof(struct SlotSettings)); + memcpy(&slotSettings, &defaultSlotSettings, sizeof(struct SlotSettings)); // initialize peripherals Serial.begin(115200); - - #ifdef DEBUG_DELAY_STARTUP - delay(3000); // allow some time for serial interface to come up - #endif - + +#ifdef DEBUG_DELAY_STARTUP + delay(3000); // allow some time for serial interface to come up +#endif + MouseBLE.begin("FABI"); KeyboardBLE.begin(""); JoystickBLE.begin(""); - + initGPIO(); initIR(); initButtons(); initDebouncers(); - initStorage(); // initialize storage if necessary - readFromEEPROMSlotNumber(0, true); // read slot from first EEPROM slot if available ! + initStorage(); // initialize storage if necessary + readFromEEPROMSlotNumber(0, true); // read slot from first EEPROM slot if available ! // NOTE: changed for RP2040! TBD: why does setBTName damage the console UART TX ?? - // setBTName(moduleName); // if BT-module installed: set advertising name + // setBTName(moduleName); // if BT-module installed: set advertising name - setKeyboardLayout(slotSettings.kbdLayout); //load keyboard layout from slot - - if(!displayInit(0)) { - Serial.println("Error, cannot find display"); // check if i2c-display connected TBD: missing i2c core2 synchronisation! + setKeyboardLayout(slotSettings.kbdLayout); //load keyboard layout from slot + + if (!displayInit(0)) { + Serial.println("Error, cannot find display"); // check if i2c-display connected TBD: missing i2c core2 synchronisation! } displayUpdate(); - -#ifdef DEBUG_OUTPUT_FULL - Serial.print(moduleName); Serial.println(" ready !"); + +#ifdef DEBUG_OUTPUT_FULL + Serial.print(moduleName); + Serial.println(" ready !"); #endif lastInteractionUpdate = millis(); // get first timestamp - } /** @@ -144,25 +146,27 @@ void loop() { // handle incoming serial data (AT-commands) while (Serial.available() > 0) { // send incoming bytes to parser - parseByte (Serial.read()); // implemented in parser.cpp + parseByte(Serial.read()); // implemented in parser.cpp } - // perform periodic updates - if (millis() >= lastInteractionUpdate + UPDATE_INTERVAL) { + // perform periodic updates + if (millis() >= lastInteractionUpdate + UPDATE_INTERVAL) { lastInteractionUpdate = millis(); // get current sensor data from core1 mutex_enter_blocking(&(sensorValues.sensorDataMutex)); - sensorData.pressure=sensorValues.pressure; + sensorData.pressure = sensorValues.pressure; mutex_exit(&(sensorValues.sensorDataMutex)); - handleUserInteraction(); // handle all mouse / joystick / button activities + handleUserInteraction(); // handle all mouse / joystick / button activities - reportValues(); // send live data to serial - updateLeds(); // mode indication via front facing neopixel LEDs - updateBTConnectionState(); // check if BT is connected (for pairing indication LED animation) - updateTones(); // mode indication via audio signals (buzzer) + reportValues(); // send live data to serial + updateLeds(); // mode indication via front facing neopixel LEDs + updateBTConnectionState(); // check if BT is connected (for pairing indication LED animation) + updateTones(); // mode indication via audio signals (buzzer) } - delay(1); // core0: sleep a bit ... + delay(1); // core0: sleep a bit ... + + //SmartButton::service(); // Asynchronous service routine, should be called periodically. // This is for the Long press. } @@ -181,7 +185,7 @@ void setup1() { Wire1.begin(); Wire1.setClock(400000); // use 400kHz I2C clock initSensors(); - initBlink(10,20); // first signs of life! + initBlink(10, 20); // first signs of life! } /** @@ -190,21 +194,21 @@ void setup1() { @return none */ void loop1() { - static uint32_t lastMPRLS_ts=0; + static uint32_t lastMPRLS_ts = 0; // if desired sampling period for MPRLS pressure sensor passed: get pressure sensor value - if (millis()-lastMPRLS_ts >= 1000/MPRLS_SAMPLINGRATE) { - lastMPRLS_ts=millis(); + if (millis() - lastMPRLS_ts >= 1000 / MPRLS_SAMPLINGRATE) { + lastMPRLS_ts = millis(); readPressure(&sensorValues); } // if calibration running: update calibration counter if (sensorValues.calib_now) { - sensorValues.calib_now--; + sensorValues.calib_now--; // calibrate sensors in the middle of the calibration period - if(sensorValues.calib_now==CALIBRATION_PERIOD/2) { + if (sensorValues.calib_now == CALIBRATION_PERIOD / 2) { calibrateSensors(); - } + } } @@ -212,8 +216,9 @@ void loop1() { if (!checkSensorWatchdog()) { //Serial.println("WATCHDOG !!"); watchdog_reboot(0, 0, 10); - while(1); + while (1) + ; } - - delay(1); // core1: sleep a bit ... + + delay(1); // core1: sleep a bit ... } diff --git a/FabiWare/FlipWare.h b/FabiWare/FlipWare.h index 8dea636..ab85d89 100644 --- a/FabiWare/FlipWare.h +++ b/FabiWare/FlipWare.h @@ -61,15 +61,15 @@ /** global constant definitions */ -#define UPDATE_INTERVAL 5 // update interval for performing HID actions (in milliseconds) -#define DEFAULT_CLICK_TIME 8 // time for mouse click (loop iterations from press to release) -#define CALIBRATION_PERIOD 1000 // approx. 1000ms calibration time +#define UPDATE_INTERVAL 5 // update interval for performing HID actions (in milliseconds) +#define DEFAULT_CLICK_TIME 8 // time for mouse click (loop iterations from press to release) +#define CALIBRATION_PERIOD 1000 // approx. 1000ms calibration time // RAM buffers and memory constraints -#define WORKINGMEM_SIZE 300 // reserved RAM for working memory (command parser, IR-rec/play) -#define MAX_KEYSTRING_LEN (WORKINGMEM_SIZE-3) // maximum length for AT command parameters -#define MAX_NAME_LEN 15 // maximum length for a slotname or ir name -#define MAX_KEYSTRINGBUFFER_LEN 500 // maximum length for all string parameters of one slot +#define WORKINGMEM_SIZE 300 // reserved RAM for working memory (command parser, IR-rec/play) +#define MAX_KEYSTRING_LEN (WORKINGMEM_SIZE - 3) // maximum length for AT command parameters +#define MAX_NAME_LEN 15 // maximum length for a slotname or ir name +#define MAX_KEYSTRINGBUFFER_LEN 500 // maximum length for all string parameters of one slot /** @@ -78,17 +78,19 @@ */ struct SlotSettings { - char slotName[MAX_NAME_LEN]; // slotname (@warning: must be always the first element, storing relies on that!) - uint16_t keystringBufferLen; - - uint16_t ts; // threshold sip - uint16_t tp; // threshold puff - uint8_t ws; // wheel stepsize - uint16_t sp; // threshold strong puff - uint16_t ss; // threshold strong sip - uint8_t bt; // bt-mode (0,1,2) - uint32_t sc; // slotcolor (0x: rrggbb) + char slotName[MAX_NAME_LEN]; // slotname (@warning: must be always the first element, storing relies on that!) + uint16_t keystringBufferLen; + + uint16_t ts; // threshold sip + uint16_t tp; // threshold puff + uint8_t ws; // wheel stepsize + uint16_t sp; // threshold strong puff + uint16_t ss; // threshold strong sip + uint8_t bt; // bt-mode (0,1,2) + uint32_t sc; // slotcolor (0x: rrggbb) char kbdLayout[6]; + uint16_t lp; // Threshold long button press. + uint16_t dp; // Threshold/Time for double press for slot change. }; /** @@ -102,7 +104,7 @@ struct SensorData { struct I2CSensorValues { int pressure; uint16_t calib_now; - mutex_t sensorDataMutex; // for synchronization of data access between cores + mutex_t sensorDataMutex; // for synchronization of data access between cores }; /** @@ -114,7 +116,7 @@ extern uint8_t actSlot; extern uint8_t addonUpgrade; extern struct SensorData sensorData; extern struct I2CSensorValues sensorValues; -extern struct SlotSettings slotSettings; +extern struct SlotSettings slotSettings; extern const struct SlotSettings defaultSlotSettings; extern uint8_t workingmem[WORKINGMEM_SIZE]; // working memory (command parser, IR-rec/play) extern char keystringBuffer[MAX_KEYSTRINGBUFFER_LEN]; // storage for all button string parameters of a slot @@ -122,33 +124,33 @@ extern char keystringBuffer[MAX_KEYSTRINGBUFFER_LEN]; // storage for all button /** set the correct strcpy/strcmp functions for TeensyLC / ARM) */ -#define strcpy_FM strcpy -#define strcmp_FM strcmp +#define strcpy_FM strcpy +#define strcmp_FM strcmp typedef char* uint_farptr_t_FM; /** * Some define checks to warn from building in debug settings */ #ifdef DEBUG_OUTPUT_MEMORY - #warning "DEBUG_OUTPUT_MEMORY active! (GUI might not work)" +#warning "DEBUG_OUTPUT_MEMORY active! (GUI might not work)" #endif #ifdef DEBUG_OUTPUT_FULL - #warning "DEBUG_OUTPUT_FULL active! (GUI might not work)" +#warning "DEBUG_OUTPUT_FULL active! (GUI might not work)" #endif #ifdef DEBUG_OUTPUT_KEYS - #warning "DEBUG_OUTPUT_KEYS active! (GUI might not work)" +#warning "DEBUG_OUTPUT_KEYS active! (GUI might not work)" #endif #ifdef DEBUG_OUTPUT_IR - #warning "DEBUG_OUTPUT_IR active! (GUI might not work)" +#warning "DEBUG_OUTPUT_IR active! (GUI might not work)" #endif #ifdef DEBUG_OUTPUT_SENSORS - #warning "DEBUG_OUTPUT_SENSORS active! (GUI might not work)" +#warning "DEBUG_OUTPUT_SENSORS active! (GUI might not work)" #endif #ifdef DEBUG_DELAY_STARTUP - #warning "DELAY_STARTUP is active, do not release this way!" +#warning "DELAY_STARTUP is active, do not release this way!" #endif #ifdef DEBUG_NO_TONE - #warning "DEBUG_NO_TONE is defined, do not release this way!" +#warning "DEBUG_NO_TONE is defined, do not release this way!" #endif #endif diff --git a/FabiWare/buttons.cpp b/FabiWare/buttons.cpp index 92982ad..052d3c7 100644 --- a/FabiWare/buttons.cpp +++ b/FabiWare/buttons.cpp @@ -14,118 +14,127 @@ */ -#include "FlipWare.h" // FABI command definitions +#include "FlipWare.h" // FABI command definitions #include "infrared.h" #include "keys.h" -struct slotButtonSettings buttons [NUMBER_OF_BUTTONS]; // array for all buttons - type definition see FlipWare.h -char * buttonKeystrings[NUMBER_OF_BUTTONS]; // pointers to keystring parameters -char keystringBuffer[MAX_KEYSTRINGBUFFER_LEN]={0}; // storage for keystring parameters for all buttons -struct buttonDebouncerType buttonDebouncers [NUMBER_OF_BUTTONS]; // array for all buttonsDebouncers - type definition see fabi.h -uint32_t buttonStates = 0; // current button states for reporting raw values (AT SR) -void initButtonKeystrings() -{ - slotSettings.keystringBufferLen=0; - for (int i=0;i puts button into programming mode (e.g. "AT BM 2" -> next AT-command defines the new function for button 2) - for the FABI, there are 17 buttons available (5 physical buttons, 12 virtual functions): + for the FABI, there are 22 buttons available (5 physical buttons, 17 virtual functions): 1-5: 3.5mm jack plugs 1-5 - 6: Sip (pressure lower than sip threshold) (pressure sensor addon required) - 7: Strong Sip (pressure sensor addon required) - 8: Puff (pressure bigger than puff threshold) (pressure sensor addon required) - 9: Strong Puff (pressure sensor addon required) - 10: StrongSip + jack plug 2 pressed - 11: StrongSip + jack plug 3 pressed - 12: StrongSip + jack plug 4 pressed - 13: StrongSip + jack plug 5 pressed - 14: StrongPuff + jack plug 2 pressed - 15: StrongPuff + jack plug 3 pressed - 16: StrongPuff + jack plug 4 pressed - 17: StrongPuff + jack plug 5 pressed + 6-10 Long press. + 11: Sip (pressure lower than sip threshold) (pressure sensor addon required) + 12: Strong Sip (pressure sensor addon required) + 13: Puff (pressure bigger than puff threshold) (pressure sensor addon required) + 14: Strong Puff (pressure sensor addon required) + 15: StrongSip + jack plug 2 pressed + 16: StrongSip + jack plug 3 pressed + 17: StrongSip + jack plug 4 pressed + 18: StrongSip + jack plug 5 pressed + 19: StrongPuff + jack plug 2 pressed + 20: StrongPuff + jack plug 3 pressed + 21: StrongPuff + jack plug 4 pressed + 22: StrongPuff + jack plug 5 pressed USB HID commands: @@ -34,6 +35,10 @@ AT CM click middle mouse button AT CD click double with left mouse button + AT PL Press left mouse button. + AT PR Press right mouse button. + AT PM Press middle mouse button. + AT HL hold the left mouse button (automatic release when user action is done) AT HR hold the right mouse button (automatic release when user action is done) AT HM hold the middle mouse button (automatic release when user action is done) @@ -79,6 +84,9 @@ AT KL change keyboard layout. No parameter prints the currently used layout. Currently supported: de_DE, en_US, es_ES, fr_FR, it_IT, sv_SE, da_DK. + AT LP Long press threshold AKA long press should be active once that time (in [ms]) has been reached. + AT DP Thrshold for Slot change by double press. In [ms]. + Housekeeping commands: AT SA save slotSettings and current button modes to next free eeprom slot under given name (e.g. "AT SA mouse1") @@ -116,6 +124,7 @@ AT IW wipe infrared memory (clear all codes) AT IL lists all stored infrared command names AT IT set code timeout value for IR Recording (e.g. "AT IT 10" sets 10 milliseconds timeout) + supported key identifiers for key commands (AT KP/KH/KR/KT): @@ -158,7 +167,7 @@ enum atCommands { CMD_ID, CMD_BM, CMD_CL, CMD_CR, CMD_CM, CMD_CD, CMD_PL, CMD_PR, CMD_PM, CMD_HL, CMD_HR, CMD_HM, CMD_RL, CMD_RR, CMD_RM, CMD_TL, CMD_TR, CMD_TM, CMD_WU, CMD_WD, CMD_WS, CMD_MX, CMD_MY, CMD_JX, CMD_JY, CMD_JZ, CMD_JT, CMD_JS, CMD_JP, CMD_JR, CMD_JH, CMD_KW, CMD_KP, CMD_KH, CMD_KT, CMD_KR, - CMD_RA, CMD_KL, CMD_SA, CMD_LO, CMD_LA, CMD_LI, CMD_NE, CMD_DE, CMD_RS, CMD_RE, CMD_NC, CMD_BT, + CMD_RA, CMD_KL, CMD_LP, CMD_DP, CMD_SA, CMD_LO, CMD_LA, CMD_LI, CMD_NE, CMD_DE, CMD_RS, CMD_RE, CMD_NC, CMD_BT, CMD_SC, CMD_SR, CMD_ER, CMD_CA, CMD_MA, CMD_WA, CMD_TS, CMD_TP, CMD_SP, CMD_SS, CMD_IR, CMD_IP, CMD_IH, CMD_IS, CMD_IC, CMD_IW, CMD_IL, CMD_IT, NUM_COMMANDS diff --git a/FabiWare/modes.cpp b/FabiWare/modes.cpp index c5e13d7..ece7a19 100644 --- a/FabiWare/modes.cpp +++ b/FabiWare/modes.cpp @@ -1,3 +1,5 @@ + + /* FLipWare - AsTeRICS Foundation For more info please visit: https://www.asterics-foundation.org @@ -19,6 +21,9 @@ #include "gpio.h" #include "tone.h" #include "utils.h" +#include "keys.h" +//#include "commands.h" +#include "display.h" /** static variables for mode handling @@ -28,14 +33,12 @@ uint8_t mouseMoveCount = 0; unsigned long currentTime; unsigned long previousTime = 0; - /** forward declarations of module-internal functions */ -void handleMovement(); +void handleMovement(); -void handleUserInteraction() -{ +void handleUserInteraction() { static uint8_t pressureRising = 0, pressureFalling = 0; static int previousPressure = 512; static int waitStable = 0; @@ -46,41 +49,48 @@ void handleUserInteraction() int strongDirThreshold; // check sip/puff activities - if (sensorData.pressure > previousPressure) pressureRising = 1; else pressureRising = 0; - if (sensorData.pressure < previousPressure) pressureFalling = 1; else pressureFalling = 0; + if (sensorData.pressure > previousPressure) + pressureRising = 1; + else + pressureRising = 0; + if (sensorData.pressure < previousPressure) + pressureFalling = 1; + else + pressureFalling = 0; previousPressure = sensorData.pressure; strongDirThreshold = STRONGMODE_MOUSE_JOYSTICK_THRESHOLD; // handle strong sip and puff actions - switch (strongSipPuffState) { + switch (strongSipPuffState) { - case STRONG_MODE_IDLE: // IDLE + case STRONG_MODE_IDLE: // IDLE if (sensorData.pressure > slotSettings.sp) { strongSipPuffState = STRONG_MODE_ENTER_STRONGPUFF; - makeTone(TONE_ENTER_STRONGPUFF, 0 ); + makeTone(TONE_ENTER_STRONGPUFF, 0); } - if (sensorData.pressure < slotSettings.ss ) { + if (sensorData.pressure < slotSettings.ss) { strongSipPuffState = STRONG_MODE_ENTER_STRONGSIP; - makeTone(TONE_ENTER_STRONGSIP, 0 ); + makeTone(TONE_ENTER_STRONGSIP, 0); } break; - case STRONG_MODE_ENTER_STRONGPUFF: // puffed strong, wait for release + case STRONG_MODE_ENTER_STRONGPUFF: // puffed strong, wait for release if (sensorData.pressure < slotSettings.tp) waitStable++; - else waitStable = 0; + else + waitStable = 0; if (waitStable >= STRONGMODE_STABLETIME) strongSipPuffState = STRONG_MODE_STRONGPUFF_ACTIVE; break; - case STRONG_MODE_STRONGPUFF_ACTIVE: // strong puff mode active + case STRONG_MODE_STRONGPUFF_ACTIVE: // strong puff mode active isHandled = 0; - //check if strong-puff + button 2/3/4/5 pressed + // check if strong-puff + button 2/3/4/5 pressed ///@note if changing, check for indices of STRONGPUFF_x_BUTTON, i & input map! - for(uint8_t i = 1; i<=4; i++) { - if(digitalRead(input_map[i]) == LOW) { - makeTone(TONE_EXIT_STRONGPUFF, 0 ); + for (uint8_t i = 1; i <= 4; i++) { + if (digitalRead(input_map[i]) == LOW) { + makeTone(TONE_EXIT_STRONGPUFF, 0); handlePress(STRONGPUFF_2_BUTTON + i - 1); handleRelease(STRONGPUFF_2_BUTTON + i - 1); strongSipPuffState = STRONG_MODE_RETURN_TO_IDLE; @@ -89,9 +99,9 @@ void handleUserInteraction() break; } } - if(!isHandled) { + if (!isHandled) { waitStable++; - if (waitStable > STRONGMODE_EXIT_TIME) { // no stick movement occurred: perform strong puff action + if (waitStable > STRONGMODE_EXIT_TIME) { // no stick movement occurred: perform strong puff action waitStable = 0; handlePress(STRONGPUFF_BUTTON); handleRelease(STRONGPUFF_BUTTON); @@ -100,21 +110,22 @@ void handleUserInteraction() } break; - case STRONG_MODE_ENTER_STRONGSIP: // sipped strong, wait for release + case STRONG_MODE_ENTER_STRONGSIP: // sipped strong, wait for release if (sensorData.pressure > slotSettings.ts) waitStable++; - else waitStable = 0; + else + waitStable = 0; if (waitStable >= STRONGMODE_STABLETIME) strongSipPuffState = STRONG_MODE_STRONGSIP_ACTIVE; break; - case STRONG_MODE_STRONGSIP_ACTIVE: // strong sip mode active + case STRONG_MODE_STRONGSIP_ACTIVE: // strong sip mode active isHandled = 0; - //check if strong-sip + button 2/3/4/5 pressed + // check if strong-sip + button 2/3/4/5 pressed ///@note if changing, check for indices of STRONGSIP_x_BUTTON, i & input map! - for(uint8_t i = 1; i<=4; i++) { - if(digitalRead(input_map[i]) == LOW) { - makeTone(TONE_EXIT_STRONGSIP, 0 ); + for (uint8_t i = 1; i <= 4; i++) { + if (digitalRead(input_map[i]) == LOW) { + makeTone(TONE_EXIT_STRONGSIP, 0); handlePress(STRONGSIP_2_BUTTON + i - 1); handleRelease(STRONGSIP_2_BUTTON + i - 1); strongSipPuffState = STRONG_MODE_RETURN_TO_IDLE; @@ -123,98 +134,155 @@ void handleUserInteraction() break; } } - if(!isHandled) { + if (!isHandled) { waitStable++; - if (waitStable > STRONGMODE_EXIT_TIME) { // no stick movement occurred: perform strong puff action + if (waitStable > STRONGMODE_EXIT_TIME) { // no stick movement occurred: perform strong puff action waitStable = 0; handlePress(STRONGSIP_BUTTON); handleRelease(STRONGSIP_BUTTON); strongSipPuffState = STRONG_MODE_RETURN_TO_IDLE; } - } + } break; case STRONG_MODE_RETURN_TO_IDLE: waitStable++; - if (waitStable > STRONGMODE_IDLE_TIME) - { + if (waitStable > STRONGMODE_IDLE_TIME) { waitStable = 0; strongSipPuffState = STRONG_MODE_IDLE; initDebouncers(); - puffState = 0; sipState = 0; + puffState = 0; + sipState = 0; } break; - default: break; + default: + break; } + if (strongSipPuffState == STRONG_MODE_IDLE) { - if (strongSipPuffState == STRONG_MODE_IDLE) - { - - //handle normal sip and puff actions - switch (puffState) { + // handle normal sip and puff actions + switch (puffState) { case SIP_PUFF_STATE_IDLE: - if (sensorData.pressure > slotSettings.tp) // handle single puff actions + if (sensorData.pressure > slotSettings.tp) // handle single puff actions { makeTone(TONE_INDICATE_PUFF, 0); - puffState = SIP_PUFF_STATE_STARTED; puffCount = 0; + puffState = SIP_PUFF_STATE_STARTED; + puffCount = 0; } break; case SIP_PUFF_STATE_STARTED: - if (!pressureRising) - { - if (puffCount++ > SIP_PUFF_SETTLE_TIME) - { + if (!pressureRising) { + if (puffCount++ > SIP_PUFF_SETTLE_TIME) { puffCount = MIN_HOLD_TIME; handlePress(PUFF_BUTTON); puffState = SIP_PUFF_STATE_PRESSED; } - } else if (puffCount) puffCount--; + } else if (puffCount) + puffCount--; break; case SIP_PUFF_STATE_PRESSED: - if (puffCount) puffCount--; + if (puffCount) + puffCount--; if ((sensorData.pressure < slotSettings.tp) && (!puffCount)) { handleRelease(PUFF_BUTTON); puffState = 0; } } - switch (sipState) { + switch (sipState) { case SIP_PUFF_STATE_IDLE: - if (sensorData.pressure < slotSettings.ts) // handle single sip actions + if (sensorData.pressure < slotSettings.ts) // handle single sip actions { makeTone(TONE_INDICATE_SIP, 0); - sipState = SIP_PUFF_STATE_STARTED; sipCount = 0; + sipState = SIP_PUFF_STATE_STARTED; + sipCount = 0; } break; case SIP_PUFF_STATE_STARTED: - if (!pressureFalling) - { - if (sipCount++ > SIP_PUFF_SETTLE_TIME) - { + if (!pressureFalling) { + if (sipCount++ > SIP_PUFF_SETTLE_TIME) { sipCount = MIN_HOLD_TIME; handlePress(SIP_BUTTON); sipState = SIP_PUFF_STATE_PRESSED; } - } else if (sipCount) sipCount--; + } else if (sipCount) + sipCount--; break; case SIP_PUFF_STATE_PRESSED: - if (sipCount) sipCount--; + if (sipCount) + sipCount--; if ((sensorData.pressure > slotSettings.ts) && (!sipCount)) { handleRelease(SIP_BUTTON); sipState = 0; } } } - + + + // check physical buttons 1-5 (only if not handled by any special sip/puff state) - if(strongSipPuffState == STRONG_MODE_IDLE) { - for (int i = 0; i < NUMBER_OF_PHYSICAL_BUTTONS; i++) { // update button press / release events - handleButton(i, digitalRead(input_map[i]) == LOW ? 1 : 0); + if (strongSipPuffState == STRONG_MODE_IDLE) { + uint16_t thresholdForLongPress = slotSettings.lp; + uint16_t thresholdDoublePress = slotSettings.dp; + static unsigned long buttonPressStartTime[NUMBER_OF_PHYSICAL_BUTTONS] = { 0 }; // Stores the start time of button presses. So that it can distinguish between the first time a button has been pressed. + static unsigned long buttonLastPressTime[NUMBER_OF_PHYSICAL_BUTTONS] = { 0 }; + + for (int i = 0; i < NUMBER_OF_PHYSICAL_BUTTONS; i++) { // update button press / release events + + + /** Double press start. **/ + if (digitalRead(input_map[i]) == HIGH) { // Button has been released. + + if (buttonLastPressTime[i] == 0) { // First button press. + buttonLastPressTime[i] = millis(); + } + + } else { // Button is being pressed. + if (buttonLastPressTime[i] != 0) { // Button has previously been pressed. + if (millis() - buttonLastPressTime[i] <= thresholdDoublePress) { // Double press. + + performCommand(CMD_NE, 0, 0, 0); // Activates next slot. + } + buttonLastPressTime[i] = 0; // Reset for next button press. + } + } + /** Double press end. **/ + + + /** Long press start. **/ + if (buttons[LONG_PRESS_BUTTON_1 + i].mode == CMD_NC) { // Makes sure that that specific button does not have a command (KEY_SPACE) in place. + handleButton(i, !digitalRead(input_map[i])); // Short press. + + } else { + if (digitalRead(input_map[i]) == LOW) { // Button has been pressed. + buttonStates |= (1 << i); // Which state is used can be seen using the command AT SR (with Serial Monitor). Also visualises it in the WebGUI. + + if (buttonPressStartTime[i] == 0) { // save press timestamp, only if not set already + buttonPressStartTime[i] = millis(); // Saves the time, when the button was pressed. + } + + if ((millis() - buttonPressStartTime[i]) >= thresholdForLongPress) { // already a long press? + handleButton(LONG_PRESS_BUTTON_1 + i, 1); // Long press. + } + } else { // When the button has been released, HIGH. + + buttonStates &= ~(1 << i); + + if ((millis() - buttonPressStartTime[i]) < thresholdForLongPress) { // was it a short press? If yes, trigger immediately + handlePress(i); + handleRelease(i); + } + + handleButton(LONG_PRESS_BUTTON_1 + i, 0); // No long press. + buttonPressStartTime[i] = 0; // Reset start time. + } + } + /** Long press end. **/ } } } diff --git a/FabiWare/modes.h b/FabiWare/modes.h index 5a9aadc..e937b78 100644 --- a/FabiWare/modes.h +++ b/FabiWare/modes.h @@ -54,6 +54,7 @@ #define STICKMODE_JOYSTICK_ZR 3 #define STICKMODE_JOYSTICK_SLIDERS 4 + /** @name handleUserInteraction @brief applies all movement / action handling according to movement data and button modes of current slot diff --git a/FabiWare/sensors.cpp b/FabiWare/sensors.cpp index 5a1455e..6281e93 100644 --- a/FabiWare/sensors.cpp +++ b/FabiWare/sensors.cpp @@ -20,27 +20,29 @@ // #define PRINT_RAWVALUES #ifdef PRINT_RAWVALUES - uint32_t ts=0; - uint8_t calibRawValue=1; - int sr=0; - int32_t raw_mid=0; +uint32_t ts = 0; +uint8_t calibRawValue = 1; +int sr = 0; +int32_t raw_mid = 0; #endif LoadcellSensor PS; -int sensorWatchdog=-1; +int sensorWatchdog = -1; -#define MPRLS_READ_TIMEOUT (20) ///< millis -#define MPRLS_STATUS_POWERED (0x40) ///< Status SPI powered bit -#define MPRLS_STATUS_BUSY (0x20) ///< Status busy bit -#define MPRLS_STATUS_FAILED (0x04) ///< Status bit for integrity fail -#define MPRLS_STATUS_MATHSAT (0x01) ///< Status bit for math saturation -#define MPRLS_STATUS_MASK (0b01100101) ///< Sensor status mask: only these bits are set +#define MPRLS_READ_TIMEOUT (20) ///< millis +#define MPRLS_STATUS_POWERED (0x40) ///< Status SPI powered bit +#define MPRLS_STATUS_BUSY (0x20) ///< Status busy bit +#define MPRLS_STATUS_FAILED (0x04) ///< Status bit for integrity fail +#define MPRLS_STATUS_MATHSAT (0x01) ///< Status bit for math saturation +#define MPRLS_STATUS_MASK (0b01100101) ///< Sensor status mask: only these bits are set /** * @brief Used pressure sensor type. We can use either the MPXV7007GP * sensor connected to an analog pin or the MPRLS sensor board with I2C */ -typedef enum {MPXV, MPRLS, NO_PRESSURE} pressure_type_t; +typedef enum { MPXV, + MPRLS, + NO_PRESSURE } pressure_type_t; pressure_type_t sensor_pressure = NO_PRESSURE; @@ -55,32 +57,32 @@ int32_t mprls_rawval = 512; @brief initialises I2C interface, prepares NAU and MPRLS readouts. [called from core 1] @return none */ -void initSensors() -{ +void initSensors() { //first: switch on LDO for sensors - pinMode(LDO_ENABLE_PIN,OUTPUT); - digitalWrite(LDO_ENABLE_PIN,HIGH); + pinMode(LDO_ENABLE_PIN, OUTPUT); + digitalWrite(LDO_ENABLE_PIN, HIGH); delay(10); - + //detect if there is an MPRLS sensor connected to I2C (Wire) Wire1.setClock(400000); // use 400kHz I2C clock Wire1.beginTransmission(MPRLS_ADDR); uint8_t result = Wire1.endTransmission(); //we found the MPRLS sensor, start the initialization if (result == 0) { - - sensor_pressure = MPRLS; + + sensor_pressure = MPRLS; // set signal processing parameters for sip/puff (MPRLS pressure sensor) PS.setGain(1.0); // adjust gain for pressure sensor - PS.enableOvershootCompensation(false); + // PS.enableOvershootCompensation(false); // TODO: enableOvershootCompensation does not exist yet. PS.setSampleRate(MPRLS_SAMPLINGRATE); PS.setMovementThreshold(5000); PS.setBaselineLowpass(0.4); PS.setNoiseLowpass(10.0); + // PS.setStartupTime(2000); - PS.enableAutoCalibration(true); + // PS.enableAutoCalibration(true); // TODO: enableAutoCalibration does not exist yet. PS.setActivityLowpass(1); PS.setIdleDetectionPeriod(500); PS.setIdleDetectionThreshold(500); @@ -89,7 +91,6 @@ void initSensors() #ifdef DEBUG_OUTPUT_SENSORS Serial.println("SEN: Calibrated internal offset"); #endif - } /** @@ -97,12 +98,11 @@ void initSensors() @brief calibrates the offset values for the sensors (pressure & force) @return none */ -void calibrateSensors() -{ +void calibrateSensors() { PS.calib(); - #ifdef PRINT_RAWVALUES - calibRawValue=1; - #endif +#ifdef PRINT_RAWVALUES + calibRawValue = 1; +#endif } @@ -113,8 +113,8 @@ void calibrateSensors() @param newVal: pointer where result will be stored @return status byte of MPRLS */ -int getMPRLSValue(int32_t * newVal) { - uint8_t buffer[4] = {0}; +int getMPRLSValue(int32_t *newVal) { + uint8_t buffer[4] = { 0 }; // request status byte // myWire.requestFrom(MPRLS_ADDR,1); @@ -144,15 +144,13 @@ int getMPRLSValue(int32_t * newVal) { @param data: pointer to I2CSensorValues struct, used by core1 @return none */ -void readPressure(struct I2CSensorValues *data) -{ +void readPressure(struct I2CSensorValues *data) { //static uint32_t ts=0; //static int32_t raw_mid=0; //int sr=0; int actPressure = 512; - switch (sensor_pressure) - { + switch (sensor_pressure) { case MPRLS: { @@ -174,7 +172,7 @@ void readPressure(struct I2CSensorValues *data) #endif int med = calculateMedian(mprls_rawval); - if (abs(med - mprls_rawval) > SPIKE_DETECTION_THRESHOLD) { + if (abs(med - mprls_rawval) > SPIKE_DETECTION_THRESHOLD) { mprls_rawval = med; } @@ -183,20 +181,22 @@ void readPressure(struct I2CSensorValues *data) if (mprls_filtered > 0) mprls_filtered = sqrt(mprls_filtered); if (mprls_filtered < 0) mprls_filtered = -sqrt(-mprls_filtered); - #ifdef PRINT_RAWVALUES - if (calibRawValue) { - calibRawValue=0; raw_mid=mprls_rawval; - } - else { - Serial.print (mprls_rawval-raw_mid); Serial.print(" "); - Serial.print (mprls_filtered*100); Serial.print(" "); - //sr= 1000000 / (micros()-ts); - //ts=micros(); - //Serial.print (sr); Serial.print(" "); - Serial.println(" "); - } - #endif - +#ifdef PRINT_RAWVALUES + if (calibRawValue) { + calibRawValue = 0; + raw_mid = mprls_rawval; + } else { + Serial.print(mprls_rawval - raw_mid); + Serial.print(" "); + Serial.print(mprls_filtered * 100); + Serial.print(" "); + //sr= 1000000 / (micros()-ts); + //ts=micros(); + //Serial.print (sr); Serial.print(" "); + Serial.println(" "); + } +#endif + actPressure = 512 + mprls_filtered / MPRLS_DIVIDER; // clamp to 1/1022 (allows disabling strong sip/puff) @@ -283,14 +283,14 @@ void quickSort(int values[], int left, int right) { @return median value */ int calculateMedian(int value) { - static int medianBuf[MEDIAN_VALUES] = {0}; + static int medianBuf[MEDIAN_VALUES] = { 0 }; static int medianBufPos = 0; int values[MEDIAN_VALUES]; medianBuf[medianBufPos] = value; medianBufPos++; if (medianBufPos >= MEDIAN_VALUES) medianBufPos = 0; - memcpy(values, medianBuf, sizeof(int)*MEDIAN_VALUES); + memcpy(values, medianBuf, sizeof(int) * MEDIAN_VALUES); quickSort(values, 0, MEDIAN_VALUES - 1); diff --git a/Settings/1switch-LongpressTest (USB).set b/Settings/1switch-LongpressTest (USB).set index a0fea8f..67d0a6e 100644 --- a/Settings/1switch-LongpressTest (USB).set +++ b/Settings/1switch-LongpressTest (USB).set @@ -1,5 +1,5 @@ Slot:moveUp -AT TT 1000 +AT LP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -18,9 +18,9 @@ AT NC AT BM 5 AT NC AT BM 6 -AT NC -AT BM 7 AT NE +AT BM 7 +AT NC AT BM 8 AT NC AT BM 9 @@ -33,7 +33,7 @@ AT BT 1 AT SC 0x036572 Slot:moveDown -AT TT 600 +AT DP 600 AT AP 5 AT AR 2 AT AI 1 @@ -52,9 +52,9 @@ AT NC AT BM 5 AT NC AT BM 6 -AT NC -AT BM 7 AT NE +AT BM 7 +AT NC AT BM 8 AT NC AT BM 9 diff --git a/Settings/1switch-Mouse (USB).md b/Settings/1switch-Mouse (USB).md index 2cc75ca..cf5cfad 100644 --- a/Settings/1switch-Mouse (USB).md +++ b/Settings/1switch-Mouse (USB).md @@ -11,12 +11,12 @@ A left click is performed automatically after 1 second of inactivity (dwell clic - Button1 = move mouse right ### Slot2 (name: moveDown, color: orange, mode:USB) -- Button1 = move mouse right +- Button1 = move mouse down ### Slot3 (name: moveLeft, color: green, mode:USB) -- Button1 = move mouse right +- Button1 = move mouse left ### Slot4 (name: moveUp, color: red, mode:USB) -- Button1 = move mouse right +- Button1 = move mouse up diff --git a/Settings/1switch-Mouse (USB).set b/Settings/1switch-Mouse (USB).set index c0201bd..c7719df 100644 --- a/Settings/1switch-Mouse (USB).set +++ b/Settings/1switch-Mouse (USB).set @@ -1,5 +1,5 @@ Slot:moveRight -AT TT 0 +AT DP 0 AT AP 5 AT AR 2 AT AI 1 @@ -33,7 +33,7 @@ AT BT 1 AT SC 0x003e8f Slot:moveDown -AT TT 0 +AT DP 0 AT AP 5 AT AR 2 AT AI 1 @@ -42,7 +42,7 @@ AT AD 1000 AT TS 0 AT TP 1023 AT BM 1 -AT MY 10 +AT MY -10 AT BM 2 AT NC AT BM 3 @@ -67,7 +67,7 @@ AT BT 1 AT SC 0x9e8400 Slot:moveLeft -AT TT 0 +AT DP 0 AT AP 5 AT AR 2 AT AI 1 @@ -101,7 +101,7 @@ AT BT 1 AT SC 0x2d8000 Slot:moveUp -AT TT 0 +AT DP 0 AT AP 5 AT AR 2 AT AI 1 @@ -110,7 +110,7 @@ AT AD 1000 AT TS 0 AT TP 1023 AT BM 1 -AT MY -10 +AT MY 10 AT BM 2 AT NC AT BM 3 diff --git a/Settings/2switch-Mouse (USB+BT).set b/Settings/2switch-Mouse (USB+BT).set index e5a0b30..b22b494 100644 --- a/Settings/2switch-Mouse (USB+BT).set +++ b/Settings/2switch-Mouse (USB+BT).set @@ -2,7 +2,7 @@ Slot:rightUSB AT SC 0xa4f245 AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -10,9 +10,9 @@ AT BT 1 AT DP 0 AT AD 1790 AT BM 1 -AT MX 10 +AT MX 40 AT BM 2 -AT NE +AT MX -40 AT BM 3 AT NC AT BM 4 @@ -22,9 +22,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC -AT BM 8 AT LO rightBT +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -36,7 +36,7 @@ Slot:downUSB AT SC 0x81fb60 AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -44,9 +44,9 @@ AT BT 1 AT DP 0 AT AD 1790 AT BM 1 -AT MY 10 +AT MY -40 AT BM 2 -AT NE +AT MY 40 AT BM 3 AT NC AT BM 4 @@ -56,9 +56,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC +AT LO downBT AT BM 8 -AT LO rightUSB +AT NC AT BM 9 AT NC AT BM 10 @@ -70,7 +70,7 @@ Slot:leftUSB AT SC 0x65fb3c AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -78,9 +78,9 @@ AT BT 1 AT DP 0 AT AD 1790 AT BM 1 -AT MX -10 +AT MX -40 AT BM 2 -AT NE +AT MX 40 AT BM 3 AT NC AT BM 4 @@ -90,9 +90,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC +AT LO leftBT AT BM 8 -AT LO rightBT +AT NC AT BM 9 AT NC AT BM 10 @@ -104,7 +104,7 @@ Slot:upUSB AT SC 0x62ff42 AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -112,9 +112,9 @@ AT BT 1 AT DP 0 AT AD 1790 AT BM 1 -AT MY -10 +AT MY 40 AT BM 2 -AT LO rightUSB +AT MY -40 AT BM 3 AT NC AT BM 4 @@ -124,9 +124,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC +AT LO upBT AT BM 8 -AT LO rightBT +AT NC AT BM 9 AT NC AT BM 10 @@ -138,7 +138,7 @@ Slot:rightBT AT SC 0x004cff AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -148,7 +148,7 @@ AT AD 1790 AT BM 1 AT MX 40 AT BM 2 -AT NE +AT MX -40 AT BM 3 AT NC AT BM 4 @@ -158,9 +158,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC -AT BM 8 AT LO rightUSB +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -172,7 +172,7 @@ Slot:downBT AT SC 0x0008ff AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -180,9 +180,9 @@ AT BT 2 AT DP 0 AT AD 1790 AT BM 1 -AT MY 40 +AT MY -40 AT BM 2 -AT NE +AT MY 40 AT BM 3 AT NC AT BM 4 @@ -192,9 +192,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC +AT LO downUSB AT BM 8 -AT LO rightUSB +AT NC AT BM 9 AT NC AT BM 10 @@ -206,7 +206,7 @@ Slot:leftBT AT SC 0x0011ff AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -216,7 +216,7 @@ AT AD 1790 AT BM 1 AT MX -40 AT BM 2 -AT NE +AT MX 40 AT BM 3 AT NC AT BM 4 @@ -226,9 +226,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC +AT LO leftUSB AT BM 8 -AT LO rightUSB +AT NC AT BM 9 AT NC AT BM 10 @@ -240,7 +240,7 @@ Slot:upBT AT SC 0x0008ff AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -248,9 +248,9 @@ AT BT 2 AT DP 0 AT AD 1790 AT BM 1 -AT MY -40 +AT MY 40 AT BM 2 -AT LO rightBT +AT MY -40 AT BM 3 AT NC AT BM 4 @@ -260,9 +260,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC +AT LO upUSB AT BM 8 -AT LO rightUSB +AT NC AT BM 9 AT NC AT BM 10 diff --git a/Settings/2switch-Mouse&Keys (USB+BT).set b/Settings/2switch-Mouse&Keys (USB+BT).set index 4829684..8627f14 100644 --- a/Settings/2switch-Mouse&Keys (USB+BT).set +++ b/Settings/2switch-Mouse&Keys (USB+BT).set @@ -1,5 +1,5 @@ Slot:rightUSB -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -10,7 +10,7 @@ AT TP 1023 AT BM 1 AT MX 10 AT BM 2 -AT NE +AT MX -10 AT BM 3 AT HL AT BM 4 @@ -20,9 +20,9 @@ AT WU AT BM 6 AT WD AT BM 7 -AT NC -AT BM 8 AT LO keysBT +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -33,7 +33,7 @@ AT BT 1 AT SC 0xa2f141 Slot:downUSB -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -42,9 +42,9 @@ AT AD 2000 AT TS 0 AT TP 1023 AT BM 1 -AT MY 10 +AT MY -10 AT BM 2 -AT NE +AT MY 10 AT BM 3 AT HL AT BM 4 @@ -54,9 +54,9 @@ AT WU AT BM 6 AT WD AT BM 7 -AT NC -AT BM 8 AT LO keysBT +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -67,7 +67,7 @@ AT BT 1 AT SC 0x7fff5c Slot:leftUSB -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -78,7 +78,7 @@ AT TP 1023 AT BM 1 AT MX -10 AT BM 2 -AT NE +AT MX 10 AT BM 3 AT HL AT BM 4 @@ -88,9 +88,9 @@ AT WU AT BM 6 AT WD AT BM 7 -AT NC -AT BM 8 AT LO keysBT +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -101,7 +101,7 @@ AT BT 1 AT SC 0x3cfb52 Slot:upUSB -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -110,9 +110,9 @@ AT AD 2000 AT TS 0 AT TP 1023 AT BM 1 -AT MY -10 +AT MY 10 AT BM 2 -AT LO rightUSB +AT MY -10 AT BM 3 AT HL AT BM 4 @@ -122,9 +122,9 @@ AT WU AT BM 6 AT WD AT BM 7 -AT NC -AT BM 8 AT LO keysBT +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -135,7 +135,7 @@ AT BT 1 AT SC 0x45ff42 Slot:keysBT -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -156,9 +156,9 @@ AT KH KEY_LEFT AT BM 6 AT KH KEY_RIGHT AT BM 7 -AT NC +AT LO rightUSB AT BM 8 -AT LO rightUSB +AT NC AT BM 9 AT NC AT BM 10 diff --git a/Settings/2switch-SimpleKeys (USB+BT).set b/Settings/2switch-SimpleKeys (USB+BT).set index 990e576..acc5137 100644 --- a/Settings/2switch-SimpleKeys (USB+BT).set +++ b/Settings/2switch-SimpleKeys (USB+BT).set @@ -2,7 +2,7 @@ Slot:keys-simple AT SC 0x782b88 AT TS 0 AT TP 1023 -AT TT 0 +AT DP 0 AT AP 5 AT AR 2 AT AI 1 @@ -26,7 +26,7 @@ AT HL AT BM 8 AT HR AT BM 9 -AT HL +AT NC AT BM 10 AT NC AT BM 11 diff --git a/Settings/3switch-Mouse (BT).set b/Settings/3switch-Mouse (BT).set index cd62969..c008c4a 100644 --- a/Settings/3switch-Mouse (BT).set +++ b/Settings/3switch-Mouse (BT).set @@ -2,7 +2,8 @@ Slot:moveRight AT SC 0xf14141 AT TS 0 AT TP 1023 -AT TT 1000 +AT LP 500 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -22,9 +23,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC -AT BM 8 AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -36,19 +37,20 @@ Slot:moveDown AT SC 0x4e4cf0 AT TS 0 AT TP 1023 -AT TT 1000 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 AT BT 2 +AT LP 500 AT DP 300 AT AD 0 AT BM 1 -AT MY 40 +AT MY -40 AT BM 2 AT CL AT BM 3 -AT MA MY120;WA50;HL;WA1000;RL +AT MA MY-120;WA50;HL;WA1000;RL AT BM 4 AT NC AT BM 5 @@ -56,9 +58,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC -AT BM 8 AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -70,7 +72,8 @@ Slot:moveLeft AT SC 0x18fbe1 AT TS 0 AT TP 1023 -AT TT 1000 +AT LP 500 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -90,9 +93,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC -AT BM 8 AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 @@ -104,7 +107,8 @@ Slot:moveUp AT SC 0xffd500 AT TS 0 AT TP 1023 -AT TT 1000 +AT LP 500 +AT DP 1000 AT AP 5 AT AR 2 AT AI 1 @@ -112,11 +116,11 @@ AT BT 2 AT DP 300 AT AD 0 AT BM 1 -AT MY -40 +AT MY 40 AT BM 2 AT CL AT BM 3 -AT MA MY-120;WA50;HL;WA1000;RL +AT MA MY120;WA50;HL;WA1000;RL AT BM 4 AT NC AT BM 5 @@ -124,9 +128,9 @@ AT NC AT BM 6 AT NC AT BM 7 -AT NC -AT BM 8 AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC AT BM 9 AT NC AT BM 10 diff --git a/Settings/5switch-Mouse (USB).set b/Settings/5switch-Mouse (USB).set index b8d4654..6043b46 100644 --- a/Settings/5switch-Mouse (USB).set +++ b/Settings/5switch-Mouse (USB).set @@ -1,5 +1,5 @@ Slot:mouse -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 @@ -8,9 +8,9 @@ AT AD 1023 AT TS 0 AT TP 1023 AT BM 1 -AT MY -5 -AT BM 2 AT MY 5 +AT BM 2 +AT MY -5 AT BM 3 AT MX -5 AT BM 4 @@ -20,11 +20,11 @@ AT HL AT BM 6 AT HR AT BM 7 -AT WD -AT BM 8 AT WU +AT BM 8 +AT WD AT BM 9 -AT HR +AT NC AT BM 10 AT NC AT BM 11 diff --git a/Settings/6switch-Keys (USB).set b/Settings/6switch-Keys (USB).set index 3eb7128..c2f7f2f 100644 --- a/Settings/6switch-Keys (USB).set +++ b/Settings/6switch-Keys (USB).set @@ -1,5 +1,5 @@ Slot:cursorkeys -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 diff --git a/Settings/7switch-Keys&Mouse (USB).set b/Settings/7switch-Keys&Mouse (USB).set index cead790..a95a8e9 100644 --- a/Settings/7switch-Keys&Mouse (USB).set +++ b/Settings/7switch-Keys&Mouse (USB).set @@ -1,5 +1,5 @@ Slot:cursorkeys -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 @@ -24,7 +24,7 @@ AT NE AT BM 8 AT NC AT BM 9 -AT HR +AT NC AT BM 10 AT NC AT BM 11 @@ -33,7 +33,7 @@ AT BT 1 AT SC 0x0f3961 Slot:mouse -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 @@ -56,9 +56,9 @@ AT HR AT BM 7 AT NE AT BM 8 -AT NC -AT BM 9 AT HR +AT BM 9 +AT NC AT BM 10 AT NC AT BM 11 diff --git a/Settings/7switch-Keys&Mouse (USB+BT).set b/Settings/7switch-Keys&Mouse (USB+BT).set index 6e767f9..66bc9ff 100644 --- a/Settings/7switch-Keys&Mouse (USB+BT).set +++ b/Settings/7switch-Keys&Mouse (USB+BT).set @@ -1,5 +1,5 @@ Slot:cursorkeys -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 @@ -24,7 +24,7 @@ AT NE AT BM 8 AT NC AT BM 9 -AT HR +AT NC AT BM 10 AT NC AT BM 11 @@ -33,7 +33,7 @@ AT BT 1 AT SC 0x0f3961 Slot:mouse -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 @@ -42,9 +42,9 @@ AT AD 0 AT TS 0 AT TP 1023 AT BM 1 -AT MY -15 -AT BM 2 AT MY 15 +AT BM 2 +AT MY -15 AT BM 3 AT MX -15 AT BM 4 @@ -54,11 +54,11 @@ AT HL AT BM 6 AT HR AT BM 7 -AT NE +AT NE AT BM 8 AT NC AT BM 9 -AT HR +AT NC AT BM 10 AT NC AT BM 11 @@ -67,7 +67,7 @@ AT BT 1 AT SC 0x451212 Slot:mouse-bt -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 @@ -76,9 +76,9 @@ AT AD 0 AT TS 0 AT TP 1023 AT BM 1 -AT MY -10 -AT BM 2 AT MY 10 +AT BM 2 +AT MY -10 AT BM 3 AT MX -10 AT BM 4 @@ -92,7 +92,7 @@ AT NE AT BM 8 AT NC AT BM 9 -AT HR +AT NC AT BM 10 AT NC AT BM 11 diff --git a/Settings/8switch-RaspiMameKeys (USB).set b/Settings/8switch-RaspiMameKeys (USB).set index 9b3c47e..62b2520 100644 --- a/Settings/8switch-RaspiMameKeys (USB).set +++ b/Settings/8switch-RaspiMameKeys (USB).set @@ -2,7 +2,7 @@ Slot:mouse AT SC 0x705200 AT TS 0 AT TP 1023 -AT TT 0 +AT DP 0 AT AP 5 AT AR 2 AT AI 1 @@ -36,7 +36,7 @@ Slot:mame1 AT SC 0x7a0000 AT TS 0 AT TP 1023 -AT TT 0 +AT DP 0 AT AP 1 AT AR 2 AT AI 1 @@ -70,7 +70,7 @@ Slot:mame2 AT SC 0x19671e AT TS 0 AT TP 1023 -AT TT 0 +AT DP 0 AT AP 5 AT AR 2 AT AI 1 diff --git a/Settings/V3/1switch-LongpressTest (USB).md b/Settings/V3/1switch-LongpressTest (USB).md new file mode 100644 index 0000000..70c498d --- /dev/null +++ b/Settings/V3/1switch-LongpressTest (USB).md @@ -0,0 +1,14 @@ +## Basic information +This configuration works with 1 switch (connected to input 1). +The switch actuates the cursor-up or cursor-down key (long-press changes function). + + +## Function assignment + +### Slot1 (name: moveUp, color: blue, mode:USB) +- Button1 = short-press: press KEY_UP (cursur up key) +- Button1 = long-press: switch to next slot + +### Slot2 (name:moveDown, color:orange, mode:USB) +- Button1 = short-press: press KEY_DOWN (cursur down key) +- Button1 = long-press: switch to next slot \ No newline at end of file diff --git a/Settings/V3/1switch-LongpressTest (USB).set b/Settings/V3/1switch-LongpressTest (USB).set new file mode 100644 index 0000000..26ca0b7 --- /dev/null +++ b/Settings/V3/1switch-LongpressTest (USB).set @@ -0,0 +1,112 @@ +Slot:moveUp +AT DP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 1000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT KH KEY_UP +AT BM 2 +AT NC +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NE +AT BM 7 +AT NC +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x036572 + +Slot:moveDown +AT DP 600 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT KH KEY_DOWN +AT BM 2 +AT NC +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NE +AT BM 7 +AT NC +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x91480d + diff --git a/Settings/V3/1switch-Mouse (USB).md b/Settings/V3/1switch-Mouse (USB).md new file mode 100644 index 0000000..cf5cfad --- /dev/null +++ b/Settings/V3/1switch-Mouse (USB).md @@ -0,0 +1,22 @@ +## Basic information +This configuration works with 1 switch (connected to input 1). +The switch controls the mouse pointer (press to move up/down/left/right). +Double-pressing the switch changes direction (activates the next slot). +A left click is performed automatically after 1 second of inactivity (dwell clicking). +(for double/right mouse clicks, a click selection tool (e.g. click2speak) can be used) + +## Function assignment + +### Slot1 (name: moveRight, color: blue, mode:USB) +- Button1 = move mouse right + +### Slot2 (name: moveDown, color: orange, mode:USB) +- Button1 = move mouse down + +### Slot3 (name: moveLeft, color: green, mode:USB) +- Button1 = move mouse left + +### Slot4 (name: moveUp, color: red, mode:USB) +- Button1 = move mouse up + + diff --git a/Settings/V3/1switch-Mouse (USB).set b/Settings/V3/1switch-Mouse (USB).set new file mode 100644 index 0000000..2044f40 --- /dev/null +++ b/Settings/V3/1switch-Mouse (USB).set @@ -0,0 +1,224 @@ +Slot:moveRight +ATLP 0 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 1000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MX 10 +AT BM 2 +AT NC +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NE +AT BM 7 +AT NC +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x003e8f + +Slot:moveDown +ATLP 0 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 1000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY 10 +AT BM 2 +AT NC +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NE +AT BM 7 +AT NC +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x9e8400 + +Slot:moveLeft +ATLP 0 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 1000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MX -10 +AT BM 2 +AT NC +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NE +AT BM 7 +AT NC +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x2d8000 + +Slot:moveUp +ATLP 0 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 1000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY -10 +AT BM 2 +AT NC +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NE +AT BM 7 +AT NC +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x9e0000 + diff --git a/Settings/V3/2switch-Mouse (USB+BT).md b/Settings/V3/2switch-Mouse (USB+BT).md new file mode 100644 index 0000000..ce28c3a --- /dev/null +++ b/Settings/V3/2switch-Mouse (USB+BT).md @@ -0,0 +1,23 @@ +## Basic information +This configuration is optimised for 2 switches (connected to inputs 1 and 2) +It allows mouse pointer control on a PC/Mac/Laptop computer (USB-mode) +and on a mobile device (iOS/Android, BT-mode). + +Default mode is: USB +Button1 is used for moving the mouse in a given direction, +Button2 is used for changing the direction (short press) or the device mode (long press). +Left mouse clicks are performed automatically after a short period of inactivity (dwell clicking). +For double/right mouse clicks, a click selection tool (e.g. click2speak) can be used. + +## Function assignment + +### USB-Mode (slots 1-4, color: green): +- Button1 = move mouse cursor right/down/left/up +- Button2 = short-press: change mouse direction; +- Button2 = long-press: switch to BT-Mode + +### BT-Mode (slots 5-8, color: blue): +- Button1 = move mouse cursor right/down/left/up +- Button2 = short-press: change mouse direction; +- Button2 = long-press: switch to USB-Mode + diff --git a/Settings/V3/2switch-Mouse (USB+BT).set b/Settings/V3/2switch-Mouse (USB+BT).set new file mode 100644 index 0000000..f5b9f1f --- /dev/null +++ b/Settings/V3/2switch-Mouse (USB+BT).set @@ -0,0 +1,456 @@ +Slot:rightUSB +AT SC 0xa4f245 +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 1 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MX 40 +AT BM 2 +AT MX -40 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO downUSB +AT BM 7 +AT LO rightBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + + +Slot:downUSB +AT SC 0x81fb60 +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 1 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MY 10 +AT BM 2 +AT MY -10 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO rightUSB +AT BM 7 +AT LO downBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:leftUSB +AT SC 0x65fb3c +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 1 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MX -10 +AT BM 2 +AT MX 10 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO upUSB +AT BM 7 +AT LO leftBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:upUSB +AT SC 0x62ff42 +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 1 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MY -10 +AT BM 2 +AT MY 10 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO rightUSB +AT BM 7 +AT LO upBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:rightBT +AT SC 0x004cff +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MX 40 +AT BM 2 +AT MX -40 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO upBT +AT BM 7 +AT LO rightUSB +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:downBT +AT SC 0x0008ff +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MY 40 +AT BM 2 +AT MY -40 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO rightBT +AT BM 7 +AT LO downUSB +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:leftBT +AT SC 0x0011ff +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MX -40 +AT BM 2 +AT MX 40 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO upBT +AT BM 7 +AT LO leftUSB +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:upBT +AT SC 0x0008ff +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 0 +AT AD 1790 +AT BM 1 +AT MY -40 +AT BM 2 +AT MY 40 +AT BM 3 +AT NC +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT LO rightBT +AT BM 7 +AT LO upUSB +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + diff --git a/Settings/V3/2switch-Mouse&Keys (USB+BT).md b/Settings/V3/2switch-Mouse&Keys (USB+BT).md new file mode 100644 index 0000000..87165de --- /dev/null +++ b/Settings/V3/2switch-Mouse&Keys (USB+BT).md @@ -0,0 +1,37 @@ +## Basic information +This configuration is optimised for 2 switches (connected to switch inputs 1 and 2), up to 5 switches might be used. +It allows mouse cursor control of a PC/Mac/Laptop computer (USB-mode) +and switch access via Bluetooth on iOS/Android (BT-mode). + +Default mode is: USB +Button1 is used for the primary function, +holding Button2 for > 1 second changes the mode. + + +## Function assignment + +### USB-Mode (slots 1-4, color: green): +- Button1 = short-press: move mouse cursor right/down/left/up; +- Button1 = long-press: Load next slot. +- Button2 = short-press: change mouse direction; +- Button2 = long-press: switch to BT-Mode +- Button3 = hold left mouse button +- Button4 = hold right mouse button +- Button5 = short-press: mouse wheel up; +- Button5 = long-press: mouse wheel down + +Buttons 3-5 are optional. +A left click is performed automatically after 2 seconds of inactivity (dwell clicking). +(for double/right mouse clicks, a click selection tool (e.g. click2speak) can be used) + + +### BT-Mode (slot 5, color: blue): +- Button1 = short-press: hold SPACE key; +- Button1 = long-press: hold ENTER key +- Button2 = short-press: hold CURSOR-UP key; +- Button2 = long-press: switch to USB-Mode +- Button3 = hold CURSOR-DOWN key +- Button4 = hold CURSOR-LEFT key +- Button5 = hold CURSOR-RIGHT key + +Buttons 3-5 are optional. \ No newline at end of file diff --git a/Settings/V3/2switch-Mouse&Keys (USB+BT).set b/Settings/V3/2switch-Mouse&Keys (USB+BT).set new file mode 100644 index 0000000..db5e5e8 --- /dev/null +++ b/Settings/V3/2switch-Mouse&Keys (USB+BT).set @@ -0,0 +1,279 @@ +Slot:rightUSB +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 2000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MX 10 +AT BM 2 +AT MX -10 +AT BM 3 +AT HL +AT BM 4 +AT CR +AT BM 5 +AT WU +AT BM 6 +AT NE +AT BM 7 +AT LO keysBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT WD +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0xa2f141 + +Slot:downUSB +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 2000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY -10 +AT BM 2 +AT MY 10 +AT BM 3 +AT HL +AT BM 4 +AT CR +AT BM 5 +AT WU +AT BM 6 +AT NE +AT BM 7 +AT LO keysBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT WD +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x7fff5c + +Slot:leftUSB +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 2000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MX -10 +AT BM 2 +AT MX 10 +AT BM 3 +AT HL +AT BM 4 +AT CR +AT BM 5 +AT WU +AT BM 6 +AT NE +AT BM 7 +AT LO keysBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT WD +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x3cfb52 + +Slot:upUSB +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 2000 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY -10 +AT BM 2 +AT MY 10 +AT BM 3 +AT HL +AT BM 4 +AT HR +AT BM 5 +AT WU +AT BM 6 +AT NE +AT BM 7 +AT LO keysBT +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT WD +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x45ff42 + +Slot:keysBT +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT KP KEY_SPACE +AT BM 2 +AT KH KEY_UP +AT BM 3 +AT KH KEY_DOWN +AT BM 4 +AT KH KEY_LEFT +AT BM 5 +AT KH KEY_RIGHT +AT BM 6 +AT KP KEY_ENTER +AT BM 7 +AT LO rightUSB +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT SC 0x004bfa + diff --git a/Settings/V3/2switch-SimpleKeys (USB+BT).md b/Settings/V3/2switch-SimpleKeys (USB+BT).md new file mode 100644 index 0000000..aa91f92 --- /dev/null +++ b/Settings/V3/2switch-SimpleKeys (USB+BT).md @@ -0,0 +1,24 @@ +## Basic information +Up to 5 switches might be used. +Button 5 actuates the Space key, Button 1 (long-press) actuates the Enter key. +The keys are sent to USB and Bluetooth (if a BT-device is paired). + +The other buttons can be connected for actuating cursor keys and left/right mouse button. + + +## Function assignment + +### Slot1 (name: keys-simple, color: purple, mode:USB+BT) +- Button1 = short-press: hold left mouse button; +- Button1 = long-press: hold KEY_ENTER (enter key) +- Button2 = hold right mouse button + +- Button3 = short-press: hold KEY_UP (cursor up key); +- Button3 = long-press: hold KEY_DOWN (cursor down key) +- Button4 = short-press: hold KEY_LEFT (cursor left key); +- Button4 = long-press: hold KEY_RIGHT (cursor right key) +- Button5 = hold KEY_SPACE (space key) + + + + diff --git a/Settings/V3/2switch-SimpleKeys (USB+BT).set b/Settings/V3/2switch-SimpleKeys (USB+BT).set new file mode 100644 index 0000000..82e52f7 --- /dev/null +++ b/Settings/V3/2switch-SimpleKeys (USB+BT).set @@ -0,0 +1,56 @@ +Slot:keys-simple +AT SC 0x782b88 +AT TS 0 +AT TP 1023 +ATLP 0 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 3 +AT DP 0 +AT AD 0 +AT BM 1 +AT HL +AT BM 2 +AT HR +AT BM 3 +AT KH KEY_UP +AT BM 4 +AT KH KEY_LEFT +AT BM 5 +AT KH KEY_SPACE +AT BM 6 +AT KH KEY_ENTER +AT BM 7 +AT NC +AT BM 8 +AT KH KEY_DOWN +AT BM 9 +AT KH KEY_RIGHT +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + diff --git a/Settings/V3/3switch-Keys (USB).md b/Settings/V3/3switch-Keys (USB).md new file mode 100644 index 0000000..8ae28ad --- /dev/null +++ b/Settings/V3/3switch-Keys (USB).md @@ -0,0 +1,22 @@ +## Basic information +This configuration is optimised for 3 buttons (connected to inputs 1-3), up to 5 buttons might be used. +It allows cursor key + space/enter key input (e.g. for gaming) via USB. + + +## Function assignment + +### Cursorkeys (slot1, color: blue): +- Button1 = short-press: hold cursor up key (KEY_UP); +- Button1 = long-press: hold cursor down key (KEY_DOWN) +- Button2 = short-press: hold cursor left key (KEY_LEFT); +- Button2 = long-press: hold cursor right key (KEY_RIGHT) +- Button3 = short-press: hold space key (KEY_SPACE); +- Button3 = long-press: hold enter key (KEY_ENTER) +- Button4 = hold left mouse button +- Button5 = hold right mouse button + +- Sip = scroll mouse wheel up +- Puff = scroll mouse wheel down + +Buttons 4-5 and sip/puff functions are optional. + diff --git a/Settings/V3/3switch-Keys (USB).set b/Settings/V3/3switch-Keys (USB).set new file mode 100644 index 0000000..c1d3f6d --- /dev/null +++ b/Settings/V3/3switch-Keys (USB).set @@ -0,0 +1,56 @@ +Slot:cursorkeys +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT KH KEY_UP +AT BM 2 +AT KH KEY_LEFT +AT BM 3 +AT KH KEY_SPACE +AT BM 4 +AT HL +AT BM 5 +AT HR +AT BM 6 +AT KH KEY_DOWN +AT BM 7 +AT KH KEY_RIGHT +AT BM 8 +AT KH KEY_ENTER +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT WU +AT BM 12 +AT WD +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x263187 + diff --git a/Settings/V3/3switch-Mouse (BT).md b/Settings/V3/3switch-Mouse (BT).md new file mode 100644 index 0000000..af7d82b --- /dev/null +++ b/Settings/V3/3switch-Mouse (BT).md @@ -0,0 +1,21 @@ +## Basic information +This configuration is optimised for 3 buttons (connected to inputs 1, 2 and 3) +It allows mouse pointer control on a mobile device (e.g. Android) via bluetooth (BT-mode). + +Button1 is used for moving the mouse pointer in the given direction. +Button2 is used for clicking the left mouse button. +A long press of Button2 creates a keyboards sequence for the Home-Key on many Android devices (GUI+Backspace). +Button3 is used for performing a swipe action in the given direction. +Changing the direction can be done be double-pressing any button. + + +## Function assignment + +### Mouse control, BT Mode (slots 1-4, color: red,blue,turquoise,yellow): +- Button1 = move mouse cursor right/down/left/up +- Button2 = short-press: click left mouse button mouse direction; +- Button2 = long press: Home-Key +- Button3 = swipe gesture right/down/left/up + +double press any button: change direction + diff --git a/Settings/V3/3switch-Mouse (BT).set b/Settings/V3/3switch-Mouse (BT).set new file mode 100644 index 0000000..02c36e8 --- /dev/null +++ b/Settings/V3/3switch-Mouse (BT).set @@ -0,0 +1,224 @@ +Slot:moveRight +AT SC 0xf14141 +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 300 +AT AD 0 +AT BM 1 +AT MX 40 +AT BM 2 +AT CL +AT BM 3 +AT MA MX120;WA50;HL;WA1000;RL +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NC +AT BM 7 +AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + +Slot:moveDown +AT SC 0x4e4cf0 +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 300 +AT AD 0 +AT BM 1 +AT MY 40 +AT BM 2 +AT CL +AT BM 3 +AT MA MY120;WA50;HL;WA1000;RL +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NC +AT BM 7 +AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + +Slot:moveLeft +AT SC 0x18fbe1 +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 300 +AT AD 0 +AT BM 1 +AT MX -40 +AT BM 2 +AT CL +AT BM 3 +AT MA MX-120;WA50;HL;WA1000;RL +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NC +AT BM 7 +AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + +Slot:moveUp +AT SC 0xffd500 +AT TS 0 +AT TP 1023 +ATLP 1000 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 2 +AT DP 300 +AT AD 0 +AT BM 1 +AT MY -40 +AT BM 2 +AT CL +AT BM 3 +AT MA MY-120;WA50;HL;WA1000;RL +AT BM 4 +AT NC +AT BM 5 +AT NC +AT BM 6 +AT NC +AT BM 7 +AT MA KH KEY_GUI;KH KEY_BACKSPACE;WA 100;KR KEY_BACKSPACE;KR KEY_GUI +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + diff --git a/Settings/V3/5switch-Keys&Mouse (USB).md b/Settings/V3/5switch-Keys&Mouse (USB).md new file mode 100644 index 0000000..a44d845 --- /dev/null +++ b/Settings/V3/5switch-Keys&Mouse (USB).md @@ -0,0 +1,27 @@ +## Basic information +This configuration is optimised for 5 buttons (connected to inputs 1-5). +It allows key control (for gaming) and mouse pointer control via USB. +Button 5 changes between key and mouse control. + + +## Function assignment + +### cursorkeys (slot1, color: blue): +- Button1 = short-press: hold cursor up key (KEY_UP); +- Button1 = long-press: hold cursor down key (KEY_DOWN) +- Button2 = short-press: hold cursor left key (KEY_LEFT); +- Button2 = long-press: hold cursor right key (KEY_RIGHT) +- Button3 = short-press: hold space key (KEY_SPACE); +- Button3 = long-press: hold enter key (KEY_ENTER) +- Button5 = load next slot + + +### mouse (slot2, color: purple): +- Button1 = short-press: move mouse up; +- Button1 = long-press: move mouse down +- Button2 = short-press: move mouse left; +- Button2 = long-press: move mouse right +- Button3 = hold left mouse button +- Button4 = hold right mouse button +- Button5 = load next slot + diff --git a/Settings/V3/5switch-Keys&Mouse (USB).set b/Settings/V3/5switch-Keys&Mouse (USB).set new file mode 100644 index 0000000..8a1ffe0 --- /dev/null +++ b/Settings/V3/5switch-Keys&Mouse (USB).set @@ -0,0 +1,112 @@ +Slot:cursorkeys +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT KH KEY_UP +AT BM 2 +AT KH KEY_LEFT +AT BM 3 +AT KH KEY_SPACE +AT BM 4 +AT NC +AT BM 5 +AT NE +AT BM 6 +AT KH KEY_DOWN +AT BM 7 +AT KH KEY_RIGHT +AT BM 8 +AT KH KEY_ENTER +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x0f3961 + +Slot:mouse +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY -15 +AT BM 2 +AT MX -15 +AT BM 3 +AT HL +AT BM 4 +AT HR +AT BM 5 +AT NE +AT BM 6 +AT MY 15 +AT BM 7 +AT MX 15 +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x451212 + diff --git a/Settings/V3/5switch-Keys&Mouse (USB+BT).md b/Settings/V3/5switch-Keys&Mouse (USB+BT).md new file mode 100644 index 0000000..e92fef9 --- /dev/null +++ b/Settings/V3/5switch-Keys&Mouse (USB+BT).md @@ -0,0 +1,35 @@ +## Basic information +This configuration is optimised for 5 buttons (connected to inputs 1-5). +It allows key control (for gaming), mouse pointer control via USB and mouse pointer control via Bluetooth (BT-mode). +Button 5 changes between these three modes. + + +## Function assignment + +### cursorkeys (slot1, color: blue): +- Button1 = short-press: hold cursor up key (KEY_UP); +- Button1 = long-press: hold cursor down key (KEY_DOWN) +- Button2 = short-press: hold cursor left key (KEY_LEFT); +- Button2 = long-press: hold cursor right key (KEY_RIGHT) +- Button3 = short-press: hold space key (KEY_SPACE); +- Button3 = long-press: hold enter key (KEY_ENTER) +- Button5 = load next slot + + +### mouse (slot2, color: purple): +- Button1 = short-press: move mouse up; +- Button1 = long-press: move mouse down +- Button2 = short-press: move mouse left; +- Button2 = long-press: move mouse right +- Button3 = hold left mouse button +- Button4 = hold right mouse button +- Button5 = load next slot + +### mouse-bt (slot3, color: yellow, BT): +- Button1 = short-press: move mouse up; +- Button1 = long-press: move mouse down +- Button2 = short-press: move mouse left; +- Button2 = long-press: move mouse right +- Button3 = hold left mouse button +- Button4 = hold right mouse button +- Button5 = load next slot diff --git a/Settings/V3/5switch-Keys&Mouse (USB+BT).set b/Settings/V3/5switch-Keys&Mouse (USB+BT).set new file mode 100644 index 0000000..a09bbad --- /dev/null +++ b/Settings/V3/5switch-Keys&Mouse (USB+BT).set @@ -0,0 +1,168 @@ +Slot:cursorkeys +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT KH KEY_UP +AT BM 2 +AT KH KEY_LEFT +AT BM 3 +AT KH KEY_SPACE +AT BM 4 +AT NC +AT BM 5 +AT NE +AT BM 6 +AT KH KEY_DOWN +AT BM 7 +AT KH KEY_RIGHT +AT BM 8 +AT KH KEY_ENTER +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x0f3961 + +Slot:mouse +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY -15 +AT BM 2 +AT MX -15 +AT BM 3 +AT HL +AT BM 4 +AT HR +AT BM 5 +AT NE +AT BM 6 +AT MY 15 +AT BM 7 +AT MX 15 +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x451212 + +Slot:mouse-bt +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT DP 300 +AT AD 0 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY -15 +AT BM 2 +AT MX -15 +AT BM 3 +AT HL +AT BM 4 +AT HR +AT BM 5 +AT NE +AT BM 6 +AT MY 15 +AT BM 7 +AT MX 15 +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 2 +AT SC 0xfad000 + diff --git a/Settings/V3/5switch-Mouse (USB).md b/Settings/V3/5switch-Mouse (USB).md new file mode 100644 index 0000000..5b8f973 --- /dev/null +++ b/Settings/V3/5switch-Mouse (USB).md @@ -0,0 +1,20 @@ +## Basic information +This configuration is optimised for 5 buttons (connected to inputs 1-5). +It allows mouse pointer control via USB. + + +## Function assignment + +### Mouse (slot1, color: blue): +- Button1 = short-press: move mouse pointer up; +- Button1 = long-press: move mouse pointer down +- Button2 = short-press: move mouse pointer left; +- Button2 = long-press: move mouse pointer right +- Button3 = hold left mouse button +- Button4 = hold right mouse button +- Button5 = short-press: scroll mouse wheel up; +- Button5 = long-press: scroll mouse wheel down + + +In order to perform right or double clicks, a click selection tool (e.g. click2speak) might be used. + diff --git a/Settings/V3/5switch-Mouse (USB).set b/Settings/V3/5switch-Mouse (USB).set new file mode 100644 index 0000000..bba7bc3 --- /dev/null +++ b/Settings/V3/5switch-Mouse (USB).set @@ -0,0 +1,56 @@ +Slot:mouse +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT DP 0 +AT AD 1023 +AT TS 0 +AT TP 1023 +AT BM 1 +AT MY -5 +AT BM 2 +AT MX -5 +AT BM 3 +AT HL +AT BM 4 +AT HR +AT BM 5 +AT WU +AT BM 6 +AT MY 5 +AT BM 7 +AT MX 5 +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT WD +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC +AT BT 1 +AT SC 0x001f99 + diff --git a/Settings/V3/5switch-RaspiMameKeys (USB).md b/Settings/V3/5switch-RaspiMameKeys (USB).md new file mode 100644 index 0000000..c380adb --- /dev/null +++ b/Settings/V3/5switch-RaspiMameKeys (USB).md @@ -0,0 +1,44 @@ +## Basic information +This configuration is dedicated for controlling the MAME game emulation software via USB keyboard/mouse (running e.g. on a RaspiberryPi computer). +You will need 5 buttons (connected to inputs 1-5) to access the essential functions for UI/menu and game control. +For more information about the MAME key mapping, see: [MAME default keys](https://docs.mamedev.org/usingmame/defaultkeys.html) + +The first FABI slot provides standard mouse pointer control via USB, and the Escape key on button 5. +Slot 2 and 3 provide keyboard keys for menu and game navigation. +Button 5 changes between the three slots. + + +## Function assignment + +### mouse (slot1, color: yellow): +- Button1 = short-press: move mouse up; +- Button1 = long-press: move mouse down +- Button2 = short-press: move mouse left; +- Button2 = long-press: move mouse right +- Button3 = click left mouse button +- Button4 = click right mouse button +- Button5 = short-press: load next slot; +- Button5 = long-press: hold escape key (KEY_ESCAPE) + + +### mame1 (slot2, color: red): +- Button1 = short-press: hold cursor up key (KEY_UP); +- Button1 = long-press: hold cursor down key (KEY_DOWN) +- Button2 = short-press: hold cursor left key (KEY_LEFT); +- Button2 = long-press: hold cursor right key (KEY_RIGHT) +- Button3 = short-press: hold ALT key (KEY_ALT); +- Button3 = long-press: hold 1 key (KEY_1) +- Button4 = hold control key (KEY_CTRL) +- Button5 = load next slot + + +### mame2 (slot3, color: green): +- Button1 = short-press: hold cursor up key (KEY_UP); +- Button1 = long-press: hold cursor down key (KEY_DOWN) +- Button2 = short-press: hold cursor left key (KEY_LEFT); +- Button2 = long-press: hold cursor right key (KEY_RIGHT) +- Button3 = short-press: hold A key (KEY_A); +- Button3 = long-press: hold F1 key (KEY_F1) +- Button4 = hold enter key (KEY_ENTER) +- Button5 = load next slot + diff --git a/Settings/V3/5switch-RaspiMameKeys (USB).set b/Settings/V3/5switch-RaspiMameKeys (USB).set new file mode 100644 index 0000000..5caaba5 --- /dev/null +++ b/Settings/V3/5switch-RaspiMameKeys (USB).set @@ -0,0 +1,169 @@ +Slot:mouse +AT SC 0x705200 +AT TS 0 +AT TP 1023 +ATLP 0 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 1 +AT DP 0 +AT AD 0 +AT BM 1 +AT MY -12 +AT BM 2 +AT MX -12 +AT BM 3 +AT CL +AT BM 4 +AT CR +AT BM 5 +AT NE +AT BM 6 +AT MY 12 +AT BM 7 +AT MX 12 +AT BM 8 +AT NC +AT BM 9 +AT NC +AT BM 10 +AT KH KEY_ESC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:mame1 +AT SC 0x7a0000 +AT TS 0 +AT TP 1023 +ATLP 0 +AT AP 1 +AT AR 2 +AT AI 1 +AT BT 1 +AT DP 0 +AT AD 0 +AT BM 1 +AT KH KEY_UP +AT BM 2 +AT KH KEY_LEFT +AT BM 3 +AT KH KEY_ALT +AT BM 4 +AT KH KEY_CTRL +AT BM 5 +AT NE +AT BM 6 +AT KH KEY_DOWN +AT BM 7 +AT KH KEY_RIGHT +AT BM 8 +AT KH KEY_1 +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC + + +Slot:mame2 +AT SC 0x19671e +AT TS 0 +AT TP 1023 +ATLP 0 +AT AP 5 +AT AR 2 +AT AI 1 +AT BT 1 +AT DP 0 +AT AD 0 +AT BM 1 +AT KP KEY_UP +AT BM 2 +AT KP KEY_LEFT +AT BM 3 +AT KP KEY_A +AT BM 4 +AT KP KEY_ENTER +AT BM 5 +AT NE +AT BM 6 +AT KP KEY_DOWN +AT BM 7 +AT KP KEY_RIGHT +AT BM 8 +AT KP KEY_F1 +AT BM 9 +AT NC +AT BM 10 +AT NC +AT BM 11 +AT NC +AT BM 12 +AT NC +AT BM 13 +AT NC +AT BM 14 +AT NC +AT BM 15 +AT NC +AT BM 16 +AT NC +AT BM 17 +AT NC +AT BM 18 +AT NC +AT BM 19 +AT NC +AT BM 20 +AT NC +AT BM 21 +AT NC +AT BM 22 +AT NC