GLBasic forum

Main forum => GLBasic - en => Topic started by: Crivens on 2011-Jul-13

Title: WebOS gestures
Post by: Crivens on 2011-Jul-13
Is there a way to use WebOS gestures in GLB? Specifically the back gesture.

Oh, and nice one on WebOS Gernot. I followed the instructions and wham my whole iOS app works perfectly on my new Palm Pre. Only downside is it seems more sensitive than the iPhone for the touch screen, so I need to adjust a couple of settings. No sweat though.

Cheers
Title: Re: WebOS gestures
Post by: Ian Price on 2011-Jul-13
The gesture area recognizes forward and back gestures with KEY(1) =back - Key(14 IIRC)=Forward.

I posted about this exact subject very recently. Unfortunately they don't actually work properly in the real world. You can get them to work, but it often takes several swipes - they aren't very effective, so definitely don't rely on them. :(

BTW The Palm phones are lovely machines. I own a Pre Plus and a Pre 2. I've also just purchased a Pixi - not arrived yet though.
Title: Re: WebOS gestures
Post by: Crivens on 2011-Jul-14
I tried using key 1 but it just quits out as soon as it loads on my Palm Pre 2. Might not bother as everything works as on my iPhone but I thought perhaps app approvals would complain if you don't follow their standards (ie. Use the back gesture instead of a menu option to go back a screen)

Cheers
Title: Re: WebOS gestures
Post by: Ian Price on 2011-Jul-14
I've used menus for all of my apps without problem - B'lox! Mined Out! and Dicey.

Re: gestures exiting You need to ensure that you use the ALLOWESCAPE FALSE command to prevent ESC from exiting via swiping. You can still exit on Pre by touching the gesture area.
Title: Re: WebOS gestures
Post by: Crivens on 2011-Jul-14
Fair enough. Might leave it like that then.

Yeah, I have ALLOWESCAPE FALSE. What exactly was the command you used to intercept the back gesture? I used something like IF KEY(1)=1 then blah blah (in work so can't check). But doing this caused it to quit straight away.

Cheers
Title: Re: WebOS gestures
Post by: Ian Price on 2011-Jul-14
That routine (IF KEY(1) THEN ....) works fine (if very erratic) for me. Make sure that you are not using WHILE TRUE (as this detects for key(1). I use WHILE quit=0

I use something like -

Code (glbasic) Select

LOCAL quit

WHILE quit=0

IF KEY(1) THEN quit=1
...
...
...
SHOWSCREEN
WEND


Then at the end of the funtion ensure that you return to the previous function.
Title: Re: WebOS gestures
Post by: Kitty Hello on 2011-Jul-14
can you quickly test if inkey$() returns anything other than an empty string for the gestures?
Title: Re: WebOS gestures
Post by: Ian Price on 2011-Jul-14
Hi Gernot, using this code

Code (glbasic) Select

ALLOWESCAPE FALSE

LOCAL quit
LOCAL a$
LOCAL n$

WHILE quit=0

a$=INKEY$()

IF a$<>"" THEN n$=a$

PRINT n$,10,10

SHOWSCREEN

IF KEY(57) THEN quit=1

WEND


The LEFT/RIGHT swipe gesture are not recognized - last character pressed remains onscreen.
Title: Re: WebOS gestures
Post by: Kitty Hello on 2011-Jul-14
print ASC(n$), please. Sorry, I have no device here @ work.
Title: Re: WebOS gestures
Post by: Ian Price on 2011-Jul-14
There is no response of any kind from the gesture area while using ASC(n$).

It is detectable when using -
Code (glbasic) Select

...
FOR n=0 to 255
IF KEY(n) THEN a=n
NEXT

PRINT a,10,10
...


Swipe left=1. Swipe right=15 (not 14 as I posted earlier).

As stated earlier this can take several attempts to display a value.
Title: Re: WebOS gestures
Post by: MrTAToad on 2011-Jul-14
I do notice swipe problems with built-in software too, so its not specific to GLBasic :)
Title: Re: WebOS gestures
Post by: Kitty Hello on 2011-Jul-14
It sort of is. I think I poll the keyboard buffer status with every call to "KEY" and that's bad, because the first key() might have the trigger, but the 2nd might check for it.
I should have used a "UpdateKeyboardState" function. It would have saved a lot of headache.
I think I have a solution for this, though! (Go, go gadget-o-keystate)
Title: Re: WebOS gestures
Post by: Ian Price on 2011-Jul-14
QuoteI think I have a solution for this, though! (Go, go gadget-o-keystate)
Cool. Go Go Gadget Gernot! :) :P

And MrTAToad - you are indeed correct - I've seen some slow/very slow responses to gestures in non-GLB apps too.
Title: Re: WebOS gestures
Post by: MrTAToad on 2011-Jul-15
Indeed - the album program seems to be pretty poor in that respect.