I am looking to change the zoom in key (command) to the spacebar. is this possible? I figure it is in the .swf file, and can not figure out see the code.
Changing default keys for zoom in/out etc..
-
-
look at the documentation page for the onkeydown event and find the correct key code for space bar. just replicate the action that is tied to the zoom in button in that event.
-
This is good for enabling the spacebar to function but I can't see a way to actually change the command for the "command" key.
All i can think is something that would be like
onkeydown(control.command,off)
Thanks VN2011 for the help
-
did you try
if(keycode == 32, action(zoom));
but also
if(keycode == 17, action(do nothing));
?
hope it helps
Tuur
-
Hi,
right, with the onkeydown, onkeyup and the keycode custom key actions can be defined,
but the default zooming keys can be changed here:
https://krpano.com/docu/xml/#control.keycodesin
https://krpano.com/docu/xml/#control.keycodesoutthe keycode for space is 32,
btw - to find out the key codes from keys add that code in the xml:
and to add the space-key for zooming-in add that code in the xml:
best regards,
Klaus -
Klaus and Tuur, Thank You!
This works, unfortunately my goal was to make refreshing the page possible by hitting Command R, but this seems to still be disabled even though the command key is no longer a zoomout key. any thoughts, or is this just not possible?
Thanks for the help everyone.
-
Hi,
key combinations often return special key codes,
try to find out if your combination returns a special value:
alternatively you can try to store the information is a key is pressed or released in variables and check for them,
e.g. this code checks if the A and B key are pressed together:Code
Display More<events onkeydown="keydown()" onkeyup="keyup()" /> <action name="keydown"> trace('keydown - ',keycode); if(keycode == 65, set(key_a_down,true)); if(keycode == 66, set(key_b_down,true)); if(key_a_down, if(key_b_down, trace('key A and B pressed'))); </action> <action name="keyup"> trace('keyup - ',keycode); if(keycode == 65, set(key_a_down,false)); if(keycode == 66, set(key_b_down,false)); </action>
best regards,
Klaus
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!