Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulator Keyboard Option for web #4845

Open
Jaqster opened this issue Jun 30, 2022 · 8 comments · May be fixed by microsoft/pxt-common-packages#1469
Open

Simulator Keyboard Option for web #4845

Jaqster opened this issue Jun 30, 2022 · 8 comments · May be fixed by microsoft/pxt-common-packages#1469
Assignees
Labels
enhancement New feature or request simulator

Comments

@Jaqster
Copy link
Member

Jaqster commented Jun 30, 2022

Teacher request - when students are testing/debugging programs that include a lot of user input ("Ask for String", "Ask for Number" blocks), it gets tiring to constantly use the game pad to enter data. It would be great to be able to substitute a full keyboard input just for the online Simulator for testing purposes.

image

@abchatra abchatra added enhancement New feature or request and removed accessibility labels Sep 28, 2022
@kiki-lee
Copy link
Contributor

kiki-lee commented Jun 7, 2023

Agreed. We have other ways to simulate input when using the computer that aren't true to the devices, so I don't see a problem with allowing things like using the full keyboard for entering letters (or even using a mouse to navigate and click instead of arrow/A) when using a simulator/phone.

@Vegz78
Copy link

Vegz78 commented Sep 16, 2023

I second this great idea!!!

-Would be a great enhancement both for teaching and debugging to able to:

  1. Type input with keyboard directly into the game.askForString()-method, as suggested here
  2. Type input with keyboard into the console with something like the Python input()-method, or an equivalent console prompt for JavaScript.
  3. Same as point 2, but with the console shown in the simulator(ref. the Console Overlay extension)

(Mouse support would also be great, but that is another issue...) ;-)

Apropos:
https://forum.makecode.com/t/keyboard-mouse-input-extension/5988
microsoft/pxt-microbit#3857

Where there is will, there is a way. -You can do it!

Keep up all the great work!

Br,
Vegard

@UnsignedArduino
Copy link

I think it would be cool if we could get keyboard and mouse and touchscreen events within Arcade. Maybe something like this: (similar to the web APIs)

simulatorOnly.onKeyUp((event: SimulatorOnly.KeyboardEvent) => {
  console.log(event);
});
{
  "key": "u",
  "keyCode": 85,
  "code": "KeyU",
  "altKey": false,
  "ctrlKey": false,
  "metaKey": false,
  "shiftKey": false,
  "repeat": false
}

Similar thing for mouse input. We should do the same for touch screens.

If we have these events implemented, then the game.askForString() function could just set up callbacks for these and it wouldn't complicate the implementation so much, plus then user games can access these as well.

@sargedev
Copy link

Perhaps simulator.mouse.x and simulator.mouse.y attributes for accessing the mouse position in code?

@Vegz78
Copy link

Vegz78 commented Sep 17, 2023

And maybe a keyboard shorcut linked to a programmable property to switch between the default gamepad input and the keyboard/mouse modes?

@sargedev
Copy link

That's a good idea too! Speaking of which, there's still no shortcut for the menu button 🤔

@UnsignedArduino
Copy link

That's a good idea too! Speaking of which, there's still no shortcut for the menu button 🤔

I think ` works now!

@Vegz78
Copy link

Vegz78 commented Oct 9, 2023

Is/should be @riknoll assigned to this, since he might soon already be finished with it?:
https://forum.makecode.com/t/keyboard-mouse-input-extension/5988/11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request simulator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants