pxt-common-packages 12.2.8 → 12.2.10

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.
Files changed (35) hide show
  1. package/libs/azureiot/built/debug/binary.js +461 -461
  2. package/libs/browser-events/browserEvents.ts +4 -4
  3. package/libs/color/built/debug/binary.js +8 -8
  4. package/libs/color-sensor/built/debug/binary.js +8 -8
  5. package/libs/controller/built/debug/binary.js +7056 -7056
  6. package/libs/controller---none/built/debug/binary.js +7036 -7036
  7. package/libs/datalogger/built/debug/binary.js +63 -63
  8. package/libs/edge-connector/built/debug/binary.js +8 -8
  9. package/libs/esp32/built/debug/binary.js +462 -462
  10. package/libs/game/_locales/game-jsdoc-strings.json +2 -2
  11. package/libs/game/_locales/game-strings.json +2 -2
  12. package/libs/game/built/debug/binary.js +6975 -6975
  13. package/libs/game/numberprompt.ts +4 -4
  14. package/libs/game/prompt.ts +11 -7
  15. package/libs/game/systemKeyboard.cpp +5 -0
  16. package/libs/game/systemKeyboard.d.ts +3 -0
  17. package/libs/lcd/built/debug/binary.js +8 -8
  18. package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
  19. package/libs/lora/built/debug/binary.js +8 -8
  20. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  21. package/libs/mqtt/built/debug/binary.js +176 -176
  22. package/libs/net/built/debug/binary.js +176 -176
  23. package/libs/net-game/built/debug/binary.js +8752 -8732
  24. package/libs/palette/built/debug/binary.js +6974 -6974
  25. package/libs/pixel/built/debug/binary.js +8 -8
  26. package/libs/power/built/debug/binary.js +8 -8
  27. package/libs/proximity/built/debug/binary.js +8 -8
  28. package/libs/radio/built/debug/binary.js +8 -8
  29. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  30. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  31. package/libs/screen/built/debug/binary.js +50 -50
  32. package/libs/servo/built/debug/binary.js +8 -8
  33. package/libs/sprite-scaling/built/debug/binary.js +6974 -6974
  34. package/libs/storyboard/built/debug/binary.js +6974 -6974
  35. package/package.json +1 -1
@@ -4,21 +4,21 @@ namespace game {
4
4
  * Ask the player for a number value.
5
5
  * @param message The message to display on the text-entry screen
6
6
  * @param answerLength The maximum number of digits the user can enter (1 - 10)
7
- * @param useSystemKeyboard Use the computer keyboard for typing if the game is being played in the simulator
7
+ * @param useOnScreenKeyboard Force the simulator to use the on-screen keyboard for text entry
8
8
  */
9
9
  //% weight=10 help=game/ask-for-number
10
10
  //% blockId=gameaskfornumber
11
- //% block="ask for number $message || and max length $answerLength use system keyboard $useSystemKeyboard"
11
+ //% block="ask for number $message || and max length $answerLength use on-screen keyboard $useOnScreenKeyboard"
12
12
  //% message.shadow=text
13
13
  //% message.defl=""
14
14
  //% answerLength.defl="6"
15
15
  //% answerLength.min=1
16
16
  //% answerLength.max=10
17
17
  //% group="Prompt"
18
- export function askForNumber(message: any, answerLength = 6, useSystemKeyboard = false) {
18
+ export function askForNumber(message: any, answerLength = 6, useOnScreenKeyboard = false) {
19
19
  answerLength = Math.max(0, Math.min(10, answerLength));
20
20
  let p = new game.NumberPrompt();
21
- const result = p.show(console.inspect(message), answerLength, useSystemKeyboard);
21
+ const result = p.show(console.inspect(message), answerLength, useOnScreenKeyboard);
22
22
  return parseFloat(result);
23
23
  }
24
24
 
@@ -19,20 +19,20 @@ namespace game {
19
19
  * Ask the player for a string value.
20
20
  * @param message The message to display on the text-entry screen
21
21
  * @param answerLength The maximum number of characters the user can enter (1 - 24)
22
- * @param useSystemKeyboard Use the computer keyboard for typing if the game is being played in the simulator
22
+ * @param useOnScreenKeyboard Force the simulator to use the on-screen keyboard for text entry
23
23
  */
24
24
  //% weight=10 help=game/ask-for-string
25
25
  //% blockId=gameaskforstring
26
- //% block="ask for string $message || and max length $answerLength use system keyboard $useSystemKeyboard"
26
+ //% block="ask for string $message || and max length $answerLength use on-screen keyboard $useOnScreenKeyboard"
27
27
  //% message.shadow=text
28
28
  //% message.defl=""
29
29
  //% answerLength.defl="12"
30
30
  //% answerLength.min=1
31
31
  //% answerLength.max=24
32
32
  //% group="Prompt"
33
- export function askForString(message: any, answerLength = 12, useSystemKeyboard = false) {
33
+ export function askForString(message: any, answerLength = 12, useOnScreenKeyboard = false) {
34
34
  let p = new game.Prompt();
35
- const result = p.show(console.inspect(message), answerLength, useSystemKeyboard);
35
+ const result = p.show(console.inspect(message), answerLength, useOnScreenKeyboard);
36
36
  return result;
37
37
  }
38
38
 
@@ -161,7 +161,7 @@ namespace game {
161
161
  this.selectionEnd = 0;
162
162
  }
163
163
 
164
- show(message: string, answerLength: number, useSystemKeyboard = false) {
164
+ show(message: string, answerLength: number, useOnScreenKeyboard = false) {
165
165
  this.message = message;
166
166
  this.answerLength = answerLength;
167
167
 
@@ -171,7 +171,7 @@ namespace game {
171
171
  this.createRenderable();
172
172
  this.confirmPressed = false;
173
173
 
174
- if (useSystemKeyboard && control.deviceDalVersion() === "sim" && helpers._isSystemKeyboardSupported()) {
174
+ if (!useOnScreenKeyboard && control.deviceDalVersion() === "sim" && helpers._isSystemKeyboardSupported()) {
175
175
  this.useSystemKeyboard = true;
176
176
  helpers._promptForText(this.answerLength, this.numbersOnly());
177
177
  this.selectionEnd = 0;
@@ -228,7 +228,7 @@ namespace game {
228
228
  }
229
229
 
230
230
  const promptText = new sprites.RenderText(this.message, CONTENT_WIDTH);
231
- const systemKeyboardText = new sprites.RenderText("Type your response using your keyboard and hit ENTER", CONTENT_WIDTH);
231
+ let systemKeyboardText: sprites.RenderText;
232
232
 
233
233
  this.renderable = scene.createRenderable(-1, () => {
234
234
  promptText.draw(screen, (screen.width >> 1) - (promptText.width >> 1), CONTENT_TOP, this.theme.colorPrompt, 0, 2)
@@ -240,6 +240,10 @@ namespace game {
240
240
  return;
241
241
  }
242
242
 
243
+ if (!systemKeyboardText) {
244
+ systemKeyboardText = new sprites.RenderText(helpers._getLocalizedInstructions(), CONTENT_WIDTH);
245
+ }
246
+
243
247
  screen.fillRect(0, screen.height - (PADDING << 1) - systemKeyboardText.height, screen.width, screen.height, this.theme.colorBottomBackground);
244
248
  systemKeyboardText.draw(screen, PADDING, screen.height - PADDING - systemKeyboardText.height, this.theme.colorBottomText);
245
249
  });
@@ -15,6 +15,11 @@ char* getTextPromptString() {
15
15
  return NULL;
16
16
  }
17
17
 
18
+ //%
19
+ char* getLocalizedInstructions() {
20
+ return NULL;
21
+ }
22
+
18
23
  //%
19
24
  int getTextPromptSelectionStart() {
20
25
  return 0;
@@ -12,6 +12,9 @@ declare namespace helpers {
12
12
  //% shim=Keyboard::getTextPromptString
13
13
  function _getTextPromptString(): string;
14
14
 
15
+ //% shim=Keyboard::getLocalizedInstructions
16
+ function _getLocalizedInstructions(): string;
17
+
15
18
  //% shim=Keyboard::getTextPromptSelectionStart
16
19
  function _getTextPromptSelectionStart(): number;
17
20
 
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P48753(s) {
59
+ function _main___P48754(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___48996 = (undefined);
70
- globals._pollEventQueue___49009 = (undefined);
69
+ globals._intervals___48997 = (undefined);
70
+ globals._pollEventQueue___49010 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P48753.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P48753.continuations = [ ]
75
+ _main___P48754.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P48754.continuations = [ ]
77
77
 
78
- function _main___P48753_mk(s) {
78
+ function _main___P48754_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P48753, depth: s.depth + 1,
81
+ parent: s, fn: _main___P48754, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P48753_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P48753
91
+ return _main___P48754
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P98602(s) {
59
+ function _main___P98605(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___98845 = (undefined);
70
- globals._pollEventQueue___98858 = (undefined);
69
+ globals._intervals___98848 = (undefined);
70
+ globals._pollEventQueue___98861 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P98602.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P98602.continuations = [ ]
75
+ _main___P98605.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P98605.continuations = [ ]
77
77
 
78
- function _main___P98602_mk(s) {
78
+ function _main___P98605_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P98602, depth: s.depth + 1,
81
+ parent: s, fn: _main___P98605, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P98602_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P98602
91
+ return _main___P98605
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P60066(s) {
59
+ function _main___P60067(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___60309 = (undefined);
70
- globals._pollEventQueue___60322 = (undefined);
69
+ globals._intervals___60310 = (undefined);
70
+ globals._pollEventQueue___60323 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P60066.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P60066.continuations = [ ]
75
+ _main___P60067.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P60067.continuations = [ ]
77
77
 
78
- function _main___P60066_mk(s) {
78
+ function _main___P60067_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P60066, depth: s.depth + 1,
81
+ parent: s, fn: _main___P60067, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P60066_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P60066
91
+ return _main___P60067
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P192086(s) {
59
+ function _main___P192099(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___192329 = (undefined);
70
- globals._pollEventQueue___192342 = (undefined);
69
+ globals._intervals___192342 = (undefined);
70
+ globals._pollEventQueue___192355 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P192086.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P192086.continuations = [ ]
75
+ _main___P192099.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P192099.continuations = [ ]
77
77
 
78
- function _main___P192086_mk(s) {
78
+ function _main___P192099_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P192086, depth: s.depth + 1,
81
+ parent: s, fn: _main___P192099, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P192086_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P192086
91
+ return _main___P192099
92
92
  })