Page 1 of 1

Arrow keys messages do not work for scrolling groups

Posted: Mon May 03, 2021 8:57 pm
by capellan
Hi all,

Arrow key messages do not work for scrolling groups
on Livecode 9.6.1

Why it's not possible to scroll an image within a group
using the arrow keys?

Thanks in advance!

Al

Re: Arrow keys messages do not work for scrolling groups

Posted: Mon May 03, 2021 9:38 pm
by jmburnod
Hi Al,
I just tested it and works here LC 9.6.1

Code: Select all

on arrowkey pkey
if pkey = Down then
      set the vscroll of group 1 to (the vscroll of group 1) +4
end if
if pkey = up then
      set the vscroll of group 1 to (the vscroll of group 1) -4
end if
end arrowkey
Kind regards
Jean-Marc

Re: Arrow keys messages do not work for scrolling groups

Posted: Tue May 04, 2021 2:44 am
by dunbarx
Works for me as well, 9.6.1 on Mac OS.

Is it that the group itself moves with each arrowKey message, as opposed to its scroll? Without Jean-Marc's handlers, that is what would happen.

So the question is what is different on your end? Is the group smaller than the full extent of its scroll? If not, arrowKey will do nothing, not even move it

Craig

Re: Arrow keys messages do not work for scrolling groups

Posted: Tue May 04, 2021 2:47 am
by capellan
Now I understand.

The script should be put in the card,
not in the group.

Thanks a lot for your help!

Code: Select all

Stack SHA-1    20c08e9d10c5200fa331757b1b0da1f1329876a2
Stack MD5       84ce2a8494a22a0b257d3d581397e0fb
Stack CRC-32   656e0b72
Scroll_group_using_arrowkeys.zip
Compressed stack
(229.3 KiB) Downloaded 114 times
Scroll_group_using_arrowkeys.jpg
Stack Screenshot