From fc71a5aecd86a0a818264f6db79c65df4c379928 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 25 May 2017 17:40:22 -0700 Subject: [PATCH] moving MesDpadButtonInfo to core --- libs/core/_locales/core-strings.json | 16 ++++++++++ libs/core/enums.d.ts | 36 ++++++++++++++++++++++ libs/core/input.cpp | 35 +++++++++++++++++++++ libs/devices/_locales/devices-strings.json | 16 ---------- libs/devices/devices.cpp | 35 --------------------- libs/devices/enums.d.ts | 36 ---------------------- 6 files changed, 87 insertions(+), 87 deletions(-) diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index 1e114fb6..afeaa547 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -149,6 +149,22 @@ "MelodyOptions.Forever|block": "forever", "MelodyOptions.OnceInBackground|block": "once in background", "MelodyOptions.Once|block": "once", + "MesDpadButtonInfo.ADown|block": "A down", + "MesDpadButtonInfo.AUp|block": "A up", + "MesDpadButtonInfo.BDown|block": "B down", + "MesDpadButtonInfo.BUp|block": "B up", + "MesDpadButtonInfo.CDown|block": "C down", + "MesDpadButtonInfo.CUp|block": "C up", + "MesDpadButtonInfo.DDown|block": "D down", + "MesDpadButtonInfo.DUp|block": "D up", + "MesDpadButtonInfo._1Down|block": "1 down", + "MesDpadButtonInfo._1Up|block": "1 up", + "MesDpadButtonInfo._2Down|block": "2 down", + "MesDpadButtonInfo._2Up|block": "2 up", + "MesDpadButtonInfo._3Down|block": "3 down", + "MesDpadButtonInfo._3Up|block": "3 up", + "MesDpadButtonInfo._4Down|block": "4 down", + "MesDpadButtonInfo._4Up|block": "4 up", "MusicEvent.BackgroundMelodyEnded|block": "background melody ended", "MusicEvent.BackgroundMelodyNotePlayed|block": "background melody note played", "MusicEvent.BackgroundMelodyPaused|block": "background melody paused", diff --git a/libs/core/enums.d.ts b/libs/core/enums.d.ts index 8699bcd0..a8193d72 100644 --- a/libs/core/enums.d.ts +++ b/libs/core/enums.d.ts @@ -121,6 +121,42 @@ declare namespace basic { //% block="8g" EightG = 10, // MICROBIT_ACCELEROMETER_EVT_8G } + + + declare enum MesDpadButtonInfo { + //% block="A down" + ADown = 1, // MES_DPAD_BUTTON_A_DOWN + //% block="A up" + AUp = 2, // MES_DPAD_BUTTON_A_UP + //% block="B down" + BDown = 3, // MES_DPAD_BUTTON_B_DOWN + //% block="B up" + BUp = 4, // MES_DPAD_BUTTON_B_UP + //% block="C down" + CDown = 5, // MES_DPAD_BUTTON_C_DOWN + //% block="C up" + CUp = 6, // MES_DPAD_BUTTON_C_UP + //% block="D down" + DDown = 7, // MES_DPAD_BUTTON_D_DOWN + //% block="D up" + DUp = 8, // MES_DPAD_BUTTON_D_UP + //% block="1 down" + _1Down = 9, // MES_DPAD_BUTTON_1_DOWN + //% block="1 up" + _1Up = 10, // MES_DPAD_BUTTON_1_UP + //% block="2 down" + _2Down = 11, // MES_DPAD_BUTTON_2_DOWN + //% block="2 up" + _2Up = 12, // MES_DPAD_BUTTON_2_UP + //% block="3 down" + _3Down = 13, // MES_DPAD_BUTTON_3_DOWN + //% block="3 up" + _3Up = 14, // MES_DPAD_BUTTON_3_UP + //% block="4 down" + _4Down = 15, // MES_DPAD_BUTTON_4_DOWN + //% block="4 up" + _4Up = 16, // MES_DPAD_BUTTON_4_UP + } declare namespace input { } diff --git a/libs/core/input.cpp b/libs/core/input.cpp index c45530e2..2711d2f2 100644 --- a/libs/core/input.cpp +++ b/libs/core/input.cpp @@ -112,6 +112,41 @@ enum class Gesture { EightG = MICROBIT_ACCELEROMETER_EVT_8G }; +enum class MesDpadButtonInfo { + //% block="A down" + ADown = MES_DPAD_BUTTON_A_DOWN, + //% block="A up" + AUp = MES_DPAD_BUTTON_A_UP, + //% block="B down" + BDown = MES_DPAD_BUTTON_B_DOWN, + //% block="B up" + BUp = MES_DPAD_BUTTON_B_UP, + //% block="C down" + CDown = MES_DPAD_BUTTON_C_DOWN, + //% block="C up" + CUp = MES_DPAD_BUTTON_C_UP, + //% block="D down" + DDown = MES_DPAD_BUTTON_D_DOWN, + //% block="D up" + DUp = MES_DPAD_BUTTON_D_UP, + //% block="1 down" + _1Down = MES_DPAD_BUTTON_1_DOWN, + //% block="1 up" + _1Up = MES_DPAD_BUTTON_1_UP, + //% block="2 down" + _2Down = MES_DPAD_BUTTON_2_DOWN, + //% block="2 up" + _2Up = MES_DPAD_BUTTON_2_UP, + //% block="3 down" + _3Down = MES_DPAD_BUTTON_3_DOWN, + //% block="3 up" + _3Up = MES_DPAD_BUTTON_3_UP, + //% block="4 down" + _4Down = MES_DPAD_BUTTON_4_DOWN, + //% block="4 up" + _4Up = MES_DPAD_BUTTON_4_UP, +}; + //% color=#B4009E weight=99 icon="\uf192" namespace input { /** diff --git a/libs/devices/_locales/devices-strings.json b/libs/devices/_locales/devices-strings.json index bf2e1b5b..9888c18d 100644 --- a/libs/devices/_locales/devices-strings.json +++ b/libs/devices/_locales/devices-strings.json @@ -25,22 +25,6 @@ "MesDeviceInfo.OrientationLandscape|block": "orientation landscape", "MesDeviceInfo.OrientationPortrait|block": "orientation portrait", "MesDeviceInfo.Shaken|block": "shaken", - "MesDpadButtonInfo.ADown|block": "A down", - "MesDpadButtonInfo.AUp|block": "A up", - "MesDpadButtonInfo.BDown|block": "B down", - "MesDpadButtonInfo.BUp|block": "B up", - "MesDpadButtonInfo.CDown|block": "C down", - "MesDpadButtonInfo.CUp|block": "C up", - "MesDpadButtonInfo.DDown|block": "D down", - "MesDpadButtonInfo.DUp|block": "D up", - "MesDpadButtonInfo._1Down|block": "1 down", - "MesDpadButtonInfo._1Up|block": "1 up", - "MesDpadButtonInfo._2Down|block": "2 down", - "MesDpadButtonInfo._2Up|block": "2 up", - "MesDpadButtonInfo._3Down|block": "3 down", - "MesDpadButtonInfo._3Up|block": "3 up", - "MesDpadButtonInfo._4Down|block": "4 down", - "MesDpadButtonInfo._4Up|block": "4 up", "MesRemoteControlEvent.forward|block": "forward", "MesRemoteControlEvent.nextTrack|block": "next track", "MesRemoteControlEvent.pause|block": "pause", diff --git a/libs/devices/devices.cpp b/libs/devices/devices.cpp index bff9d3aa..abd05076 100644 --- a/libs/devices/devices.cpp +++ b/libs/devices/devices.cpp @@ -85,41 +85,6 @@ enum class MesRemoteControlEvent { volumeDown = MES_REMOTE_CONTROL_EVT_VOLUMEDOWN, }; -enum class MesDpadButtonInfo { - //% block="A down" - ADown = MES_DPAD_BUTTON_A_DOWN, - //% block="A up" - AUp = MES_DPAD_BUTTON_A_UP, - //% block="B down" - BDown = MES_DPAD_BUTTON_B_DOWN, - //% block="B up" - BUp = MES_DPAD_BUTTON_B_UP, - //% block="C down" - CDown = MES_DPAD_BUTTON_C_DOWN, - //% block="C up" - CUp = MES_DPAD_BUTTON_C_UP, - //% block="D down" - DDown = MES_DPAD_BUTTON_D_DOWN, - //% block="D up" - DUp = MES_DPAD_BUTTON_D_UP, - //% block="1 down" - _1Down = MES_DPAD_BUTTON_1_DOWN, - //% block="1 up" - _1Up = MES_DPAD_BUTTON_1_UP, - //% block="2 down" - _2Down = MES_DPAD_BUTTON_2_DOWN, - //% block="2 up" - _2Up = MES_DPAD_BUTTON_2_UP, - //% block="3 down" - _3Down = MES_DPAD_BUTTON_3_DOWN, - //% block="3 up" - _3Up = MES_DPAD_BUTTON_3_UP, - //% block="4 down" - _4Down = MES_DPAD_BUTTON_4_DOWN, - //% block="4 up" - _4Up = MES_DPAD_BUTTON_4_UP, -}; - /** * Control a phone with the BBC micro:bit via Bluetooth. */ diff --git a/libs/devices/enums.d.ts b/libs/devices/enums.d.ts index 6cf3d381..2a3fe98c 100644 --- a/libs/devices/enums.d.ts +++ b/libs/devices/enums.d.ts @@ -85,42 +85,6 @@ //% block="volume down" volumeDown = 9, // MES_REMOTE_CONTROL_EVT_VOLUMEDOWN } - - - declare enum MesDpadButtonInfo { - //% block="A down" - ADown = 1, // MES_DPAD_BUTTON_A_DOWN - //% block="A up" - AUp = 2, // MES_DPAD_BUTTON_A_UP - //% block="B down" - BDown = 3, // MES_DPAD_BUTTON_B_DOWN - //% block="B up" - BUp = 4, // MES_DPAD_BUTTON_B_UP - //% block="C down" - CDown = 5, // MES_DPAD_BUTTON_C_DOWN - //% block="C up" - CUp = 6, // MES_DPAD_BUTTON_C_UP - //% block="D down" - DDown = 7, // MES_DPAD_BUTTON_D_DOWN - //% block="D up" - DUp = 8, // MES_DPAD_BUTTON_D_UP - //% block="1 down" - _1Down = 9, // MES_DPAD_BUTTON_1_DOWN - //% block="1 up" - _1Up = 10, // MES_DPAD_BUTTON_1_UP - //% block="2 down" - _2Down = 11, // MES_DPAD_BUTTON_2_DOWN - //% block="2 up" - _2Up = 12, // MES_DPAD_BUTTON_2_UP - //% block="3 down" - _3Down = 13, // MES_DPAD_BUTTON_3_DOWN - //% block="3 up" - _3Up = 14, // MES_DPAD_BUTTON_3_UP - //% block="4 down" - _4Down = 15, // MES_DPAD_BUTTON_4_DOWN - //% block="4 up" - _4Up = 16, // MES_DPAD_BUTTON_4_UP - } declare namespace devices { }