HP Prime touch button



#5

I'm trying to learn some programming concepts for the HP Prime and I wonder how you can create touch buttons within a program to perform a specific action.
On the other hand, I also wonder if there is any alternative to the command CHOOSE to create a menu on the screen.
With my limited knowledge I suspect that with the command GETPIX I can get the information of a pixel region but which is the command to get the touch on the screen?


#6

The command you're looking for is called MOUSE


#7

Thank you Han, but how to use this command? I don't see in the user guide enough information about this topic.


#8

Quote:
Thank you Han, but how to use this command? I don't see in the user guide enough information about this topic.

Page 549-553 gives you a list of other I/O commands including mouse.

Syntax: MOUSE[(index)]

Returns two lists describing the current location of each
potential pointer (or empty lists if the pointers are not
used). The output is {x , y, original z, original y, type}
where type is 0 (for new), 1 (for completed), 2 (for drag),
3 (for stretch), 4 (for rotate), and 5 (for long click).
The optional parameter index is the nth element that
would have been returned—x, y, original x, etc.—had the
parameter been omitted (or –1 if no pointer activity had
occurred).

For touch/taps, the second of the two lists is empty. For pinch-like motions, both lists are non-empty (each list corresponding to a touchpoint on the screen).

Try the following program snippet:

EXPORT EGMOUSE()
BEGIN
WHILE 1 DO
PRINT(MOUSE());
END;
END;

Press [On] to abort; otherwise touch/drag the screen.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime touch periodic table : new version Mic 4 245 11-25-2013, 05:29 PM
Last Post: Terje Vallestad
  Touch periodic table on HP Prime - revisited Terje Vallestad 2 171 11-23-2013, 11:47 AM
Last Post: Mic
  HP Prime: the drama of the Apps button, shutdown, formatting, nothing solves Davi Ribeiro de Oliveira 0 135 11-17-2013, 07:23 AM
Last Post: Davi Ribeiro de Oliveira
  HP Prime: the drama of the Apps button, shutdown, formatting, nothing solves Davi Ribeiro de Oliveira 1 161 11-16-2013, 11:26 PM
Last Post: Michael de Estrada
  ENG button (like Casio calculators) on HP Prime uklo 3 254 11-04-2013, 09:45 PM
Last Post: LHH
  How to create a touch button [HP Prime] uklo 1 163 11-02-2013, 02:03 PM
Last Post: Marcus von Cube, Germany
  Touch periodic table on HP Prime Mic 30 1,197 10-27-2013, 04:45 AM
Last Post: Les Koller
  Tic Tac Toe touch for HP Prime Mic 6 322 10-25-2013, 03:02 AM
Last Post: Mic
  best button cell batteries JDonley 6 312 01-30-2013, 10:00 PM
Last Post: JDonley
  Sharp PC-1500 question (F2 button disabled?) LHH 7 316 12-03-2012, 08:34 PM
Last Post: LHH

Forum Jump: