(Trying to) Capture MultiTouch Gestures With Javascript

I recently bought a new MacBook Pro, complete with the MultiTouch trackpad. One issue I have with it, is that I can’t use the pinch zoom gesture with web based maps or images. It increases font size, instead of zooming. So I donned my cape and exclaimed “This looks like a job for JAVASCRIPT!”

First, I wanted to see if the zoom gesture was sending any key events (particularly the cmd+= and cmd+-). It was a long shot, and as you would expect, it wasn’t the case.

The option was to monitor a particular div, whose height is constrained to the single letter ‘M’ (for Em… get it?). It works, but you’ve got a limited number of zoom levels.

You can test it out my horrid zoom detection yourself. You don’t need a MultiTouch trackpad, the keyboard shortcuts for increasing/decreasing text size should work.

Other issues: modern browsers resize all text. I had hoped to get around that by converting Em’s to px (16px to 1em in WebKit, in case you were wondering), but that didn’t work. A workaround would be to detect the amount of change in height, then *downsize* the font using CSS px, but I decided it’s probably best to stop experimenting with it.

It’s possible that the browser is sending a mouse event, but I hadn’t checked that quite yet. If/when I get some time, I may report back. Or you maybe someone reading will take this idea and run with it. Just let me know, okay?

links for 2008-05-04

links for 2008-04-21

links for 2008-04-19

links for 2008-04-09

links for 2008-03-24

ExpanDrive, The Finder, and OS X Accounts

I may be in the minority in using multiple accounts on a mac, but I figure this may help some people.

Me and my wife shared* a MacBook for a while and I was constantly wanting to transfer files from one of our user accounts home directory to the other. I don’t think there is any way to do so with the Finder without using shared folders. Normally, I’d end up dropping to the terminal, and copying whatever file over using my *flex* super user privileges (sudo cp /Users/[username]/[file] /Users/[currentuser]/[wherever]/). Not ideal, especially if you want to be able to walk someone through the procedure over the phone or IM.

However, I recently bought a license for ExpanDrive, and realized pretty quickly, that I could use to access the files stored in another user’s profile on the same machine.

First, you’ll have to make sure you have the remote login set up in sharing (basically the ssh daemon).

Second, set up a drive using ExpanDrive using your other account’s credentials

Finally, connect to the new drive. Profit!

*”shared” meaning I hijacked it on occasion.

links for 2008-03-20

links for 2008-03-19

links for 2008-03-14

Copyright © 2007 prototypecreative.com. All rights reserved.