From 7e078513f76850b2fd3ec901c9f855fd347d0c83 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 5 Oct 2021 21:38:56 +0200 Subject: [PATCH] resolved #796 by adding event migration --- src/common/jsonDefinitions.hxx | 78 +++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/src/common/jsonDefinitions.hxx b/src/common/jsonDefinitions.hxx index 35053864f..514751ae0 100644 --- a/src/common/jsonDefinitions.hxx +++ b/src/common/jsonDefinitions.hxx @@ -35,7 +35,9 @@ NLOHMANN_JSON_SERIALIZE_ENUM(JoyDir, { {JoyDir::NONE, nullptr}, {JoyDir::ANALOG, "analog"}, {JoyDir::NEG, "negative"}, - {JoyDir::POS, "positive"} + {JoyDir::POS, "positive"}, + // converted mappings + {JoyDir::POS, "position"}, }) NLOHMANN_JSON_SERIALIZE_ENUM(JoyHatDir, { @@ -57,6 +59,8 @@ NLOHMANN_JSON_SERIALIZE_ENUM(EventMode, { {EventMode::kCompuMateMode, "kCompuMateMode"}, {EventMode::kCommonMode, "kCommonMode"}, {EventMode::kNumModes, "kNumModes"}, + // converted mappings + {EventMode::kKeyboardMode, "kKeypadMode"}, }) NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, { @@ -408,7 +412,77 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, { {Event::Redo, "Redo"}, {Event::AbortEdit, "AbortEdit"}, {Event::EndEdit, "EndEdit"}, - {Event::LastType, "LastType"} + {Event::LastType, "LastType"}, + // converted mappings + {Event::LeftJoystickUp, "JoystickZeroUp"}, + {Event::LeftJoystickDown, "JoystickZeroDown"}, + {Event::LeftJoystickLeft, "JoystickZeroLeft"}, + {Event::LeftJoystickRight, "JoystickZeroRight"}, + {Event::LeftJoystickFire, "JoystickZeroFire"}, + {Event::LeftJoystickFire5, "JoystickZeroFire5"}, + {Event::LeftJoystickFire9, "JoystickZeroFire9"}, + {Event::RightJoystickUp, "JoystickOneUp"}, + {Event::RightJoystickDown, "JoystickOneDown"}, + {Event::RightJoystickLeft, "JoystickOneLeft"}, + {Event::RightJoystickRight, "JoystickOneRight"}, + {Event::RightJoystickFire, "JoystickOneFire"}, + {Event::RightJoystickFire5, "JoystickOneFire5"}, + {Event::RightJoystickFire9, "JoystickOneFire9"}, + {Event::QTJoystickThreeUp, "JoystickTwoUp"}, + {Event::QTJoystickThreeDown, "JoystickTwoDown"}, + {Event::QTJoystickThreeLeft, "JoystickTwoLeft"}, + {Event::QTJoystickThreeRight, "JoystickTwoRight"}, + {Event::QTJoystickThreeFire, "JoystickTwoFire"}, + {Event::QTJoystickFourUp, "JoystickThreeUp"}, + {Event::QTJoystickFourDown, "JoystickThreeDown"}, + {Event::QTJoystickFourLeft, "JoystickThreeLeft"}, + {Event::QTJoystickFourRight, "JoystickThreeRight"}, + {Event::QTJoystickFourFire, "JoystickThreeFire"}, + {Event::LeftPaddleADecrease, "PaddleZeroDecrease"}, + {Event::LeftPaddleAIncrease, "PaddleZeroIncrease"}, + {Event::LeftPaddleAAnalog, "PaddleZeroAnalog"}, + {Event::LeftPaddleAFire, "PaddleZeroFire"}, + {Event::LeftPaddleBDecrease, "PaddleOneDecrease"}, + {Event::LeftPaddleBIncrease, "PaddleOneIncrease"}, + {Event::LeftPaddleBAnalog, "PaddleOneAnalog"}, + {Event::LeftPaddleBFire, "PaddleOneFire"}, + {Event::RightPaddleADecrease, "PaddleTwoDecrease"}, + {Event::RightPaddleAIncrease, "PaddleTwoIncrease"}, + {Event::RightPaddleAAnalog, "PaddleTwoAnalog"}, + {Event::RightPaddleAFire, "PaddleTwoFire"}, + {Event::RightPaddleBDecrease, "PaddleThreeDecrease"}, + {Event::RightPaddleBIncrease, "PaddleThreeIncrease"}, + {Event::RightPaddleBAnalog, "PaddleThreeAnalog"}, + {Event::RightPaddleBFire, "PaddleThreeFire"}, + {Event::QTPaddle3AFire, "PaddleFourFire"}, + {Event::QTPaddle3BFire, "PaddleFiveFire"}, + {Event::QTPaddle4AFire, "PaddleSixFire"}, + {Event::QTPaddle4BFire, "PaddleSevenFire"}, + {Event::LeftKeyboard1, "KeyboardZero1"}, + {Event::LeftKeyboard2, "KeyboardZero2"}, + {Event::LeftKeyboard3, "KeyboardZero3"}, + {Event::LeftKeyboard4, "KeyboardZero4"}, + {Event::LeftKeyboard5, "KeyboardZero5"}, + {Event::LeftKeyboard6, "KeyboardZero6"}, + {Event::LeftKeyboard7, "KeyboardZero7"}, + {Event::LeftKeyboard8, "KeyboardZero8"}, + {Event::LeftKeyboard9, "KeyboardZero9"}, + {Event::LeftKeyboardStar, "KeyboardZeroStar"}, + {Event::LeftKeyboard0, "KeyboardZero0"}, + {Event::LeftKeyboardPound, "KeyboardZeroPound"}, + {Event::RightKeyboard1, "KeyboardOne1"}, + {Event::RightKeyboard2, "KeyboardOne2"}, + {Event::RightKeyboard3, "KeyboardOne3"}, + {Event::RightKeyboard4, "KeyboardOne4"}, + {Event::RightKeyboard5, "KeyboardOne5"}, + {Event::RightKeyboard6, "KeyboardOne6"}, + {Event::RightKeyboard7, "KeyboardOne7"}, + {Event::RightKeyboard8, "KeyboardOne8"}, + {Event::RightKeyboard9, "KeyboardOne9"}, + {Event::RightKeyboardStar, "KeyboardOneStar"}, + {Event::RightKeyboard0, "KeyboardOne0"}, + {Event::RightKeyboardPound, "KeyboardOnePound"}, + }) NLOHMANN_JSON_SERIALIZE_ENUM(StellaKey, {