View Full Version : Zoom out key behaviour
Rick Workman
02-06-2008, 05:04 PM
I've looked on the forum for discussion on this issue; hope I haven't missed something obvious.
The zoom out key (control/command) doesn't seem to auto-repeat like the zoom-in key (shift). Instead it has to be pressed repeatedly to continue zooming out.
Is there an easy workaround to make it behave like the zoom in key?
Rick
phberlin
02-06-2008, 05:20 PM
Hhm, I cannot repeat this problem -- for me, they both work just the same: The panorama is being zoomed in/out as long as the respective key is pressed.
Maybe a problem with your keyboard? Try setting another key as Zoom-Out-Key and see if your problem still persists. For example:
(Must be set inside your <parameters> section:)
keys = 39|37|38|40|187|189|36|32
keySensitivity = 120
This will set set the PLUS and MINUS-keys for zooming in and out. (This has also the advantage that it works the same on Mac as on Windows, while using Shift and CTRL respectivly Shift and APPLE forces you to inform the user what keys depending on his OS will work for him). For other key-codes, look at the list by Adobe (http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001113.html).
Hope that helps... Regards, Phberlin
cheathamlane
02-06-2008, 10:34 PM
Hey Rick:
I have encountered this on the Mac, but not reliably -- so it's doubly frustrating. I haven't tried explicitly setting the keyboard commands like Phberlin recommends, but that might be worth a shot. If you try it, let me know.
Cheers,
Rick Workman
02-07-2008, 04:13 PM
So I've spent a bit more time digging in to this. Some observations:
1. It always happens on my Mac (OSX 10.4.11, FPP 2.2, wireless keyboard). It does not occur on my Dell laptop. I've only tested "offline", so there's no browser dependancy.
2. I made a small Flash app which just provides a trace of Keyboard events to the stage. In a frame:
import flash.events.*
stage.addEventListener(KeyboardEvent.KEY_DOWN,hand ler);
stage.addEventListener(KeyboardEvent.KEY_UP,handle r);
function handler(event:KeyboardEvent) {
trace(event);
}
Note: inside the Flash CS3 environment, you may have to disable keyboard shortcuts to see all key events.
When I run this I notice that on the Mac, keys like shift/control/command are not auto-repeated on my Mac configuration, but are on the Dell. (All normal character keys do auto-repeat on the Mac.)
So I think this implies that auto-repeat for my Mac keyboard configuration for shift/command/control keys, must be handled in software somewhere (FPP?). This seems to be working for shift but not for command. On the Dell, because these keys seem to autorepeat at the keyboard level, any software problem would be masked.
So I think my workaround, since I'm building a custom skin in any case, is to try and disable FPP's keyboard handling (at least for zoom keys) using the "keys" parameter suggested by phberlin and write my own keyboard handling in ActionScript. Not a big deal, but I was hoping to avoid it.
Rick
P.S. Another observation on the Mac: inside Flash CS3, both the control and command keys seem to generate the same key event information, i.e., keyCode=17, charCode=0 . However, inside the Flash player, only the command key generates events; the control key does not. Doesn't seem seem very friendly. Also explains why FPP can't mimic QT's key behaviour (shift=zoom in, control=zoom out).
cheathamlane
02-07-2008, 04:35 PM
Rick --
All good info. I've filed it away... Thanks for sharing your research.
Cheers,
Rick Workman
02-08-2008, 02:18 PM
Just a (hopefully) final note:
I've implemented my workaround and it seems to work well. A couple of notes to anybody considering doing something like this:
1. I had to set the disableKeys parameter to 1 to get it to work properly; otherwise FPP still seems to get in the way. This means you have to implement handlers for all the navigation keys you're interested in.
2. Implementation is quite simple: just set panKey/tiltKey/zoomKey on relevant KEY_DOWN events (+1/-1 seem to work well) and reset to zero on KEY_UP. Use a Timer to implement auto-repeat; as a precaution I filtered out autorepeats generated by the keyboard.
This could probably be implemented as a trivial plugin if you only had FPP content. I have other content so this mechanism had to be enabled/disabled depending on current content.
I still suspect the current FPP has a bug in this area. As a further indication, I get the following trace when FPP is handling the key events:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::KeyboardEvent@dd49ec1 to flash.events.TimerEvent.
at CubePanorama/::doKeyRepeat()
at CubePanorama/::doKey()
This doesn't seem to affect correct operation (other than my original issue), but would suggest that there's something not quite right.
Rick
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.