WebOS gestures

Previous topic - Next topic

Crivens

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
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

#1
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.
I came. I saw. I played.

Crivens

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
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

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.
I came. I saw. I played.

Crivens

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
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

#5
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.
I came. I saw. I played.

Kitty Hello

can you quickly test if inkey$() returns anything other than an empty string for the gestures?

Ian Price

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.
I came. I saw. I played.

Kitty Hello

print ASC(n$), please. Sorry, I have no device here @ work.

Ian Price

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.
I came. I saw. I played.

MrTAToad

I do notice swipe problems with built-in software too, so its not specific to GLBasic :)

Kitty Hello

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)

Ian Price

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.
I came. I saw. I played.

MrTAToad

Indeed - the album program seems to be pretty poor in that respect.