pen and its quirks

Try this:
works fine on android!

h=txth("Q"):w=txtw("Q"):a="   Click here to exit ":t=txtw(a)
While 1
  cls:?:?:?a:?"    or anywhere else"
  rect w,h,w+t,5*h
  locate 6,0:?"Pen|Mouse new event: ";pen(0)
  ?"Pen last down|Mouse down: ";u;" ";v
  ?"Pen down|Mouse Left down:  ";pen(3)
  ?"Pen last/current|Mouse Left down:";pen(4);" ";pen(5)
  ?"Mouse current:";Pen(10);" ";Pen(11)
  ?"Mouse Left,Middle,Right down: ",pen(12),pen(14),pen(13)
  ?:?"Pen on|off are inactive"
  ?"Any reference to pen(0) resets the pen,"
  ?"and pause the program!!"
  ?"Not for arcade games, but otherwise applicable"
  if u>w && u<w+t && v>h && v<5*h then exit loop
  pause 3


Similar for me using 64 bit Linux Mint. Reports current mouse position AND clicking in the rectangle exits as it should. Nothing else...


Thanks for trying!

Still usefull on android tablet and phone


My mistake. I should have thought of 'touch'. You have my permission to totally disregard my previous post... lol


So been mousing around?

me in Windows laptop, I have:
pen(3) 'true / false left mouse click
pen(4) 'current mouseX
pen(5) 'current mouseY

Right mouse was taken over for SmallBASIC Editor | screen functions while on a run.

What is it you are doing in Android that can't be done in Windows (except get all pen(x) reads) ?
Doesn't the following cover all the bases, Arcade function-wise, in Windows and Android?

' pen test.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-12

while 1
rect 10, 10, 100, 100
locate 2, 4: ? "exit"
locate 2, 12: ? "Also try dragging mouse with left button down."
mx = pen(4) : my = pen(5)
locate 6, 1: ? "Mouse x, y = ";mx, my
locate 8, 1: ? "Last Left Mouse Click x, y = "; lx, ly
if pen(3) then ' left mouse click (right mouse click is for SB editor)
lx = mx : ly = my
if 10 < mx and mx < 100 and 10 < my and my < 100 then
cls: end
locate 10, 1: ? "Notice as you hold left mouse down, last left is updated"
showpage 'reduce flicker
delay 30
showpage 'reduce flicker
delay 30

I mean who needs all the other pen(x) readings?
What am I missing function wise, what can you do in Android that I can't in Windows.

Thanks, now I know: what works for me on Windows, might not work for those using Android.

Cross platform is not perfect, yet.

I am curious, where exactly the mouse is (Your finger moving over tap screen, I am assuming.) when -1, -1 is returned.

Anywhere ....
both on prestigio as on galaxy s3
that's why I called it quirks.

I tried various techniques....
Of course workarounds are possible...




Sorry to hear about this, glad to know what you are experiencing!

Thanks for your report, I'll see if I can find the cause for the next update.