Arrow keys messages do not work for scrolling groups

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Arrow keys messages do not work for scrolling groups

Post by capellan » Mon May 03, 2021 8:57 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Arrow keys messages do not work for scrolling groups

Post by jmburnod » Mon May 03, 2021 9:38 pm

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
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9647
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Arrow keys messages do not work for scrolling groups

Post by dunbarx » Tue May 04, 2021 2:44 am

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
Last edited by dunbarx on Tue May 04, 2021 2:49 am, edited 1 time in total.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Arrow keys messages do not work for scrolling groups

Post by capellan » Tue May 04, 2021 2:47 am

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 53 times
Scroll_group_using_arrowkeys.jpg
Stack Screenshot

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”