You are not logged in.

HansNyb

Professional

  • "HansNyb" started this thread

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

1

Tuesday, September 4th 2012, 5:43pm

Keyboard control

I just noticed on my updated tour that panning with arrow keys does not work.

I can see in the documentation that it says.

"Keyboard controls - currently not supported but manually already possible via xml events and actions."

How would it be possible to make panning with actions using the arrow keys?

Hans

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

2

Tuesday, September 4th 2012, 6:21pm

krpano key down

onkeydown="trace(keycode);" pipe to an action to recreate flash.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Tuesday, September 4th 2012, 8:49pm

Hi,

here a full example for keyboard panning/zooming for Desktop HTML5:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<events name="html5_keyboard_controls" devices="html5+desktop" keep="true"
    	onkeydown="html5_keydown();"
    	onkeyup="html5_keyup();"
    	/>

<action name="html5_keydown">
  if(keycode == 37, set(hlookat_moveforce,-1));
  if(keycode == 39, set(hlookat_moveforce,+1));
  if(keycode == 38, set(vlookat_moveforce,-1));
  if(keycode == 40, set(vlookat_moveforce,+1));
  if(keycode == 16, set(fov_moveforce,-1));
  if(keycode == 17, set(fov_moveforce,+1));
</action>

<action name="html5_keyup">
  if(keycode == 37, set(hlookat_moveforce,0));
  if(keycode == 39, set(hlookat_moveforce,0));
  if(keycode == 38, set(vlookat_moveforce,0));
  if(keycode == 40, set(vlookat_moveforce,0));
  if(keycode == 16, set(fov_moveforce,0));
  if(keycode == 17, set(fov_moveforce,0));
</action>


Best regards,
Klaus

Tuur

Sage

Posts: 3,129

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Tuesday, September 4th 2012, 10:43pm

http://www.virtualtuur.com
Skype:studiotuur