pxt-arcade 2.0.51 → 2.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -356,10 +356,6 @@ declare namespace pxsim.browserEvents {
356
356
  interface BrowserEventsBoard extends CommonBoard {
357
357
  mouseState: MouseState;
358
358
  }
359
- const INTERNAL_KEY_DOWN = 6870;
360
- const INTERNAL_KEY_UP = 6871;
361
- const INTERNAL_POINTER_DOWN = 6868;
362
- const INTERNAL_POINTER_UP = 6869;
363
359
  type MouseEvent = "pointerdown" | "pointerup" | "pointermove" | "pointerleave" | "pointerenter" | "pointercancel" | "pointerover" | "pointerout";
364
360
  class MouseState {
365
361
  protected x: number;
@@ -843,10 +843,10 @@ var pxsim;
843
843
  browserEvents.onKeyboardEvent = onKeyboardEvent;
844
844
  function fireEvent(key, pressed) {
845
845
  if (pressed) {
846
- pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_DOWN, key);
846
+ pxsim.board().bus.queue(6866, key);
847
847
  }
848
848
  else {
849
- pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_UP, key);
849
+ pxsim.board().bus.queue(6867, key);
850
850
  }
851
851
  }
852
852
  function getValueForKey(event) {
@@ -1040,10 +1040,6 @@ var pxsim;
1040
1040
  var browserEvents;
1041
1041
  (function (browserEvents) {
1042
1042
  const THROTTLE_INTERVAL = 50;
1043
- browserEvents.INTERNAL_KEY_DOWN = 6870;
1044
- browserEvents.INTERNAL_KEY_UP = 6871;
1045
- browserEvents.INTERNAL_POINTER_DOWN = 6868;
1046
- browserEvents.INTERNAL_POINTER_UP = 6869;
1047
1043
  class MouseState {
1048
1044
  constructor() {
1049
1045
  this.onMove = pxsim.U.throttle(() => {
@@ -1066,16 +1062,9 @@ var pxsim;
1066
1062
  "pointerover",
1067
1063
  "pointerout",
1068
1064
  ];
1069
- let eventId = 6857 + events.indexOf(event.type);
1070
- if (event.type === "pointerdown") {
1071
- eventId = browserEvents.INTERNAL_POINTER_DOWN;
1072
- }
1073
- else if (event.type === "pointerup") {
1074
- eventId = browserEvents.INTERNAL_POINTER_UP;
1075
- }
1076
1065
  // We add 1 to the button here because the left button is 0 and
1077
1066
  // that's used as a wildcard in our event bus
1078
- pxsim.board().bus.queue(eventId, (event.button || 0) + 1);
1067
+ pxsim.board().bus.queue(6857 + events.indexOf(event.type), (event.button || 0) + 1);
1079
1068
  }
1080
1069
  onWheelEvent(dx, dy, dz) {
1081
1070
  this.dx = dx;
package/built/sim.js CHANGED
@@ -4599,10 +4599,10 @@ var pxsim;
4599
4599
  browserEvents.onKeyboardEvent = onKeyboardEvent;
4600
4600
  function fireEvent(key, pressed) {
4601
4601
  if (pressed) {
4602
- pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_DOWN, key);
4602
+ pxsim.board().bus.queue(6866, key);
4603
4603
  }
4604
4604
  else {
4605
- pxsim.board().bus.queue(browserEvents.INTERNAL_KEY_UP, key);
4605
+ pxsim.board().bus.queue(6867, key);
4606
4606
  }
4607
4607
  }
4608
4608
  function getValueForKey(event) {
@@ -4796,10 +4796,6 @@ var pxsim;
4796
4796
  var browserEvents;
4797
4797
  (function (browserEvents) {
4798
4798
  const THROTTLE_INTERVAL = 50;
4799
- browserEvents.INTERNAL_KEY_DOWN = 6870;
4800
- browserEvents.INTERNAL_KEY_UP = 6871;
4801
- browserEvents.INTERNAL_POINTER_DOWN = 6868;
4802
- browserEvents.INTERNAL_POINTER_UP = 6869;
4803
4799
  class MouseState {
4804
4800
  constructor() {
4805
4801
  this.onMove = pxsim.U.throttle(() => {
@@ -4822,16 +4818,9 @@ var pxsim;
4822
4818
  "pointerover",
4823
4819
  "pointerout",
4824
4820
  ];
4825
- let eventId = 6857 + events.indexOf(event.type);
4826
- if (event.type === "pointerdown") {
4827
- eventId = browserEvents.INTERNAL_POINTER_DOWN;
4828
- }
4829
- else if (event.type === "pointerup") {
4830
- eventId = browserEvents.INTERNAL_POINTER_UP;
4831
- }
4832
4821
  // We add 1 to the button here because the left button is 0 and
4833
4822
  // that's used as a wildcard in our event bus
4834
- pxsim.board().bus.queue(eventId, (event.button || 0) + 1);
4823
+ pxsim.board().bus.queue(6857 + events.indexOf(event.type), (event.button || 0) + 1);
4835
4824
  }
4836
4825
  onWheelEvent(dx, dy, dz) {
4837
4826
  this.dx = dx;