You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Taurus

Trainee

  • "Taurus" started this thread

Posts: 136

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

1

Friday, October 19th 2018, 9:01pm

SOLVED - the problem with mouse coordinates on mobile devices

Hi, Klaus and colleagues
help solve the problem with coordinates on mobile devices android
after pressing the mouse button (touching the screen with a finger), the coordinate values along the x axis appear in the log
on the computer works correctly, on the smartphone - no

example

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<plugin name="p4Scroll"
    url="green.png"
    keep="true"
    parent="stage"
    align="center"
    width="50%"
    height="50%"
    alpha="0.9"
    autoalpha="true"
    zorder="100"
    enabled="true"
    capture="true"
    handcursor="true"
   ondown="scrollDown()" 
   onup="scrollUP()"
/> 
<action name="scrollDown" >
showlog(true);trace(!!!!DOWN);copy(prew_x, mouse.x);scrollDn2();
</action>
<action name="scrollDn2" >
trace(mouse.x,/,mouse.stagex);
if(plugin[p4Scroll].pressed,  delayedcall(0.0, scrollDn2());)
</action>
<action name="scrollUP" >
sub(mous_delta, mouse.x, prew_x); if(mous_delta != 0, set(dir_x, calc(mous_delta GT 0 ? -1 : 1 ));trace(!!!!UP_prew_x=,prew_x,/,mouse.x=,mouse.x,/,mous_delta=,mous_delta,/,dir_x=,dir_x); slide_list(get(activeplan), get(dir_x)); , trace(!!!!UP_prew_x=,prew_x,/,mouse.x=,mouse.x,/,mous_delta=,mous_delta,/,dir_x=,dir_x);toggle_plan(););
</action>


Thanks
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.19pr16

This post has been edited 1 times, last edit by "Taurus" (Oct 20th 2018, 3:32pm) with the following reason: solved


2

Saturday, October 20th 2018, 11:09am

Hi,

that's very probably related to the parent="STAGE" usage, try removing that setting.

When using parent="STAGE" the element is placed outside the krpano viewer DOM structure and there the viewer can't capture/track the mouse and touch events anymore correctly for all cases.

I'm already thinking about redesigning the parent="STAGE" feature, because it is often used differently than thought and makes problems because of the way how it works.

Best regards,
Klaus

Taurus

Trainee

  • "Taurus" started this thread

Posts: 136

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

3

Saturday, October 20th 2018, 11:40am

Hi, Klaus
Yes, I already understood the problem
see example now
Thank you

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<krpano>

<plugin name="list_cont"
        type="container"
        keep="true"
        align="center"
        zorder="90"
        maskchildren="true"
        width="calc:stagewidth * 0.9"
        height="calc:stageheight * 0.9"
        bgcolor="0xffaaaa"
        bgalpha="0.5"
        enabled="true"
/>

<plugin name="p4Scroll"
    url="0_3100.png"
    keep="true"
    parent="list_cont"
    align="center"
    scale="0.2"
    alpha="1"
    autoalpha="true"
    zorder="90"
    enabled="true"
    capture="true"
    handcursor="true"
   ondown="scrollDown()" 
   onup="scrollUP()"
   onloaded="set(_plan_ratio, calc(plugin[p4Scroll].imagewidth/plugin[p4Scroll].imageheight));
             set(screen_ratio, calc(stagewidth/stageheight)); 
             if (_plan_ratio LT screen_ratio, 
                              set(plugin[p4Scroll].scale, calc(stageheight * 0.9 / plugin[p4Scroll].imageheight));
                               , 
                              set(plugin[p4Scroll].scale, calc(stagewidth * 0.9 / plugin[%1_%2].imagewidth)); 
                 );"
/> 

<action name="scrollDown" >
showlog(true);trace(!!!!DOWN);copy(prew_x, mouse.x);scrollDn2();
</action>
<action name="scrollDn2" >
trace(mouse.x,/,mouse.stagex);
if(plugin[p4Scroll].pressed,  delayedcall(0.0, scrollDn2());)
</action>
<action name="scrollUP" >
sub(mous_delta, mouse.x, prew_x); if(mous_delta != 0, set(dir_x, calc(mous_delta GT 0 ? -1 : 1 ));trace(!!!!UP_prew_x=,prew_x,/,mouse.x=,mouse.x,/,mous_delta=,mous_delta,/,dir_x=,dir_x); slide_list(get(activeplan), get(dir_x)); , trace(!!!!UP_prew_x=,prew_x,/,mouse.x=,mouse.x,/,mous_delta=,mous_delta,/,dir_x=,dir_x);toggle_plan(););
</action>


</krpano>
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.19pr16