diff --git a/_includes/screenshot.html b/_includes/screenshot.html index a1e9689ff..fa7ef75f2 100644 --- a/_includes/screenshot.html +++ b/_includes/screenshot.html @@ -1,7 +1,15 @@ +{% assign include_width = "" %} +{% assign include_height = "" %} +{% if include.width %} + {% capture include_width %} width="{{ include.width }}"{% endcapture %} +{% endif %} +{% if include.height %} + {% capture include_height %} height="{{ include.height }}"{% endcapture %} +{% endif %}
- {{ include.title }} + {{ include.title }}
{{ include.title }} diff --git a/_posts/2014-03-30-running-on-azure.md b/_posts/2014-03-30-running-on-azure.md index de40a4958..0ca561bc4 100644 --- a/_posts/2014-03-30-running-on-azure.md +++ b/_posts/2014-03-30-running-on-azure.md @@ -48,7 +48,7 @@ would happily report: but it would NEVER display anything but deployment information. Instead, I had to browse the log files using Azure's "FTP DIAGNOSTIC LOGS" link on the web portal -- which presents the logs as one big, ugly, fragmented mess: -![Azure Logs](/blog/images/iisnode_logs.png) +![Azure Logs](/blog/images/iisnode-logs.jpg) Sigh. But at least the site is up and fully operational now. diff --git a/_posts/2014-03-31-browser-compatibility-woes.md b/_posts/2014-03-31-browser-compatibility-woes.md index 2f29a656e..a58e37b90 100644 --- a/_posts/2014-03-31-browser-compatibility-woes.md +++ b/_posts/2014-03-31-browser-compatibility-woes.md @@ -24,7 +24,7 @@ I've done what testing I can with the Android SDK and the "Android Virtual Devic looks fine -- you click/tap on the PC's screen, the soft keyboard pops up, and typing works. So I guess Silk is just an outlier. I'm not sure what I'll do about it yet (or even what I can do). -![PCjs in AVD](/blog/images/avd_tablet.png) +![PCjs in AVD](/blog/images/avd-tablet.jpg) --- diff --git a/_posts/2014-06-14-halt-and-catch-liar.md b/_posts/2014-06-14-halt-and-catch-liar.md index fe2dd65c6..2a33cb5a8 100644 --- a/_posts/2014-06-14-halt-and-catch-liar.md +++ b/_posts/2014-06-14-halt-and-catch-liar.md @@ -27,7 +27,7 @@ And centerpiece of this whole conceit -- the cloning of the IBM PC ROM BIOS. Wh scene from Episode 2, where Brilliant Engineer looks at Hot Programmer's whiteboard in awe. Apparently, he is easily awed, because he did the same thing when Sales Guy wrote "2x fast, 1/2 price" on an earlier whiteboard. -["Halt and Catch Fire" Scene from Episode 2](/blog/images/halt-and-catch-liar.jpg) +["Halt and Catch Fire" Scene from Episode 2](/blog/images/halt-and-catch-liar.jpg) So if you deconstruct the code on this whiteboard, you quickly notice that while it IS assembly language, it is NOT the sort of assembly language you would find in a ROM BIOS, let alone ANYTHING that would leave you in awe. diff --git a/_posts/2016-03-06-touching-windows.md b/_posts/2016-03-06-touching-windows.md new file mode 100644 index 000000000..c7bbb2f52 --- /dev/null +++ b/_posts/2016-03-06-touching-windows.md @@ -0,0 +1,47 @@ +--- +layout: post +title: Touching Windows +date: 2016-03-06 09:00:00 +permalink: /blog/2016/03/06/ +--- + +Yesterday, I fired up [Windows 3.1](/disks/pc/windows/3.10/) and played a complete game of +[Windows Solitaire](https://en.wikipedia.org/wiki/Microsoft_Solitaire) on my iPad. And I won! + +{% comment %}[Windows Solitaire on iPad](/blog/images/ipad-solitaire.jpg){% endcomment %} +{% include screenshot.html src="/blog/images/ipad-solitaire-small.jpg" title="iPad running Solitaire on Windows 3.10" link="/blog/images/ipad-solitaire.jpg" %} + +Converting touch events to mouse events can be a bit, um, touchy. The basic touch events are: + + - `touchstart` + - `touchmove` + - `touchend` + +which roughly correspond to `mousedown`, `mousemove`, and `mouseup` events, except that your finger isn't +exactly like a mouse -- it doesn't have *buttons* for one thing -- so there are several usability problems +that must be solved. + +One of the problems is how to deal with the *default behaviors* of touch events. For example, tapping on a +PCjs screen is normally how you trigger the iPad's soft keyboard, and dragging your finger across the screen +normally scrolls the page up and down. However, you don't want *either* of those behaviors when you're +trying to move the machine's mouse pointer around or click on things. + +PCjs attempts to resolve the tapping problem by disabling default behaviors most of the time, except when +two taps occur more than 1/2 second apart. This allows a quick *double-tap* to be treated as a double-click, +while a pair of slower taps allows the soft keyboard to activate. + +Another problem is how to differentiate between *moving the mouse* (ie, without any buttons pressed) and +*dragging the mouse* (ie, with the left button pressed). Newer devices offer the option of relying on "3D Touch" +(aka Force Touch), and using pressure to determine the user's intent, but most devices don't have that feature, +and I'm not sure I'd want to rely on that anyway. + +The PCjs soution: if you *tap and hold* for more than 200ms, and then start moving, your movements become the +equivalent of a *mouse drag* operation. + +This is my first stab at touch-to-mouse conversion, and it's not perfect, but it's already fairly usable, +as my Solitaire experiment demonstrates. And there are still some open questions, such as how to intuitively +support operations like *right drag*, since the current *mouse drag* operation is inherently *left drag*; +one solution would be to rely on multi-touch and use two fingers to trigger right-button operations. + +*[@jeffpar](http://twitter.com/jeffpar)* +*March 6, 2016* diff --git a/blog/images/avd_tablet.png b/blog/images/avd_tablet.png deleted file mode 100644 index ef8daa23d..000000000 Binary files a/blog/images/avd_tablet.png and /dev/null differ diff --git a/blog/images/halt-and-catch-liar-thumbnail.jpg b/blog/images/halt-and-catch-liar-small.jpg similarity index 100% rename from blog/images/halt-and-catch-liar-thumbnail.jpg rename to blog/images/halt-and-catch-liar-small.jpg diff --git a/blog/images/iisnode_logs.png b/blog/images/iisnode_logs.png deleted file mode 100644 index fa10239c4..000000000 Binary files a/blog/images/iisnode_logs.png and /dev/null differ