codefrau / SqueakJS

A Squeak Smalltalk VM in Javascript
https://squeak.js.org
MIT License
371 stars 76 forks source link

Enable keyboard input on touch devices #42

Closed fniephaus closed 8 years ago

fniephaus commented 9 years ago

Work in progress. Not ready to merge yet.

This aims to address #4.

Already working on:

Not working on:

Feel free to comment on the below :smiley:

codefrau commented 9 years ago

Works on my iPad, nice!

But I think a floating "keyboard button" to bring up the keyboard would be better (more discoverable). Additionally, we need a "cmd" button, so we can use cmd-p for print-it etc. (as I had it in the iPad version of Etoys https://www.youtube.com/watch?v=gYrp31fH-Jk and we might also learn from Pyonkee, one of the few Squeak apps in the AppStore http://softumeya.com/pyonkee/en/)

Speaking of which, if we had that, then cmd-tap could mean right click too, obviously ...

Also, in newer Squeak images we actually could get a notification when a text morph is focused (via compositionWindowManager) and pop up the keyboard automatically. We just need to hack the platform detection (i.e. change the 5th literal from 'Win32' to 'Web') and fake ImmWin32Plugin.primSetCompositionWindowPosition.

fniephaus commented 9 years ago

Two screenshots taken from the TeamViewer iOS app: 2015-07-29 14 30 00 2015-07-29 14 30 05

Maybe something similar to this?

codefrau commented 9 years ago

Looks good to me.

fniephaus commented 9 years ago

How about a virtual game controller like this? https://github.com/austinhallock/html5-virtual-game-controller#examples

codefrau commented 9 years ago

Well we do need a way to emulate keys that are not on the system keyboard, e.g. cursor keys and modifiers. So yeah, something like the game controller may be nice.

fniephaus commented 9 years ago

How about this (only visible on touch devices): 2015-07-30 18 41 11

Click on Mouse: 2015-07-30 18 40 26

Click on Keyboard 2015-07-30 18 40 58

codefrau commented 8 years ago

Hi Fabio, thank you for the design studies and initial implementation! I think the keyboard button idea is still valid, but the on-screen joystick is not so nice after all. We do have a better touch handling now (8262926740f3ef14c56501466c523dae5bbd9f5d) so for the time being I'm closing this. We still want to add in keyboard support, maybe we can salvage something from this patch. Thank you so much!