Add swipe control to screensaver page

Solves #665
This commit is contained in:
Edward Firmo
2023-12-18 03:59:17 +01:00
parent e45e848501
commit b38829ae32
19 changed files with 347 additions and 0 deletions

View File

@@ -24,6 +24,18 @@ Variable (int32) orign
Scope: local
Value: 0
Timer swipestore
Attributes
ID : 4
Scope : local
Period (ms): 50
Enabled : no
Events
Timer Event
swipex=tch0
swipey=tch1
TouchCap wakeup
Attributes
ID : 1
@@ -34,3 +46,48 @@ TouchCap wakeup
Touch Press Event
page orign.val
TouchCap swipe
Attributes
ID : 3
Scope: local
Value: 0
Events
Touch Press Event
swipestore.en=1 // Start swipestore timer
Touch Release Event
swipestore.en=0
// Touch has ended, x
if(tch0==0)
{
swipec=swipex-tch2
// From Left to Right
if(swipec>swipedx&&api==1)
{
page buttonpage04
}
// Right to Left
swipec2=0-swipedx
if(swipec<swipec2&&api==1)
{
page buttonpage01
}
}
// Touch has ended, y
if(tch1==0)
{
swipec=swipey-tch3
// From Up to Down
if(swipec>100&&api==1)
{
page buttonpage02
}
// Down to Up
swipec2=0-swipedy
if(swipec<-100&&api==1)
{
page buttonpage03
}
}