Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 7c87013

Browse files
committed
Send default shake event
1 parent 344f3ca commit 7c87013

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export async function activate(context: vscode.ExtensionContext) {
216216
}
217217

218218
break;
219-
219+
case WEBVIEW_MESSAGES.GESTURE:
220220
case WEBVIEW_MESSAGES.SENSOR_CHANGED:
221221
handleGestureTelemetry(message.text);
222222
console.log(`Sensor changed ${messageJson} \n`);

src/view/components/microbit/Microbit.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
SENSOR_LIST,
88
VSCODE_MESSAGES_TO_WEBVIEW,
99
WEBVIEW_MESSAGES,
10+
GESTURES,
1011
} from "../../constants";
1112
import "../../styles/Simulator.css";
1213
import * as TOOLBAR_SVG from "../../svgs/toolbar_svg";
@@ -27,7 +28,7 @@ const DEFAULT_STATE = {
2728
[SENSOR_LIST.MOTION_Y]: 0,
2829
[SENSOR_LIST.MOTION_Z]: 0,
2930
},
30-
currentSelectedGesture: undefined,
31+
currentSelectedGesture: GESTURES[0],
3132
};
3233

3334
export class Microbit extends React.Component<{}, IState> {

src/view/components/toolbar/motion/Accelerometer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { SENSOR_LIST } from "../../../constants";
2+
import { SENSOR_LIST, GESTURES } from "../../../constants";
33
import { ISensorProps, ISliderProps } from "../../../viewUtils";
44
import { ThreeDimensionSlider } from "./threeDimensionSlider/ThreeDimensionSlider";
55
import { Dropdown } from "../../Dropdown";
@@ -50,7 +50,7 @@ interface IProps {
5050
onSelectGestures?: (event: React.ChangeEvent<HTMLSelectElement>) => void;
5151
onSendGesture?: () => void;
5252
}
53-
const GESTURES = ["shake", "up"];
53+
5454
const GESTURE_BUTTON_MESSAGE = "Send Gesture";
5555

5656
export const Accelerometer: React.FC<IProps> = (props: IProps) => {

src/view/constants.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,18 @@ export enum SENSOR_LIST {
9999
MOTION_Z = "motion_z",
100100
}
101101

102+
export const GESTURES = [
103+
"shake",
104+
"up",
105+
"down",
106+
"left",
107+
"right",
108+
"face up",
109+
"face down",
110+
"freefall",
111+
"3g",
112+
"6g",
113+
"8g",
114+
];
115+
102116
export default CONSTANTS;

src/view/styles/Dropdown.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.dropdown {
22
background: var(--vscode-debugToolBar-background);
3-
border-color: var(--vscode-highContrastButtonBorderOverride-color);
3+
border-color: var(--vscode-foreground);
44
border-radius: 2px;
55
max-width: 300px;
66
min-width: 240px;

0 commit comments

Comments
 (0)