lorenzo906 / m2tklib

Automatically exported from code.google.com/p/m2tklib
0 stars 0 forks source link

Support touch screen #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
add a procedure which returns the element (or elements) which are under a given 
(x/y) position

Original issue reported on code.google.com by olikr...@gmail.com on 4 Jan 2013 at 8:26

GoogleCodeExporter commented 8 years ago
find_by_xy() added (m2draw.c)
actions are not yet fully implemented (select msg)

Original comment by olikr...@gmail.com on 5 Jan 2013 at 12:29

GoogleCodeExporter commented 8 years ago
select strategy touch screen:
1) x/y available: find element, if found: set focus & set flag, if not found: 
remove focus & clear flag
2) x/y not available & flag is set: clear flag and send select message to 
element

select strategy with mouse control:
1) x/y available: find element and set focus
2) Mouse button == select pin

introduce new option "t" for touch screen 

Original comment by olikr...@gmail.com on 5 Jan 2013 at 7:54

GoogleCodeExporter commented 8 years ago
read only flag overrides 't' flag: change touch screen focus only if 'r' is 
zero and 't' is one

Original comment by olikr...@gmail.com on 5 Jan 2013 at 9:32

GoogleCodeExporter commented 8 years ago
todo
- expand queue to support x/y values
- create new event handler (ehts, maybe eh4bsts which supports both)
- provide example code for new event source

Original comment by olikr...@gmail.com on 5 Jan 2013 at 11:03

GoogleCodeExporter commented 8 years ago
todo
- expand queue to support x/y values --> DONE
- create new event handler (ehts, maybe eh4bsts which supports both) 
    --> Still pending
- provide example code for new event source
- do initial test with sdl example

Original comment by olikr...@gmail.com on 6 Jan 2013 at 12:49

GoogleCodeExporter commented 8 years ago
sdl example still not working --> x/y not correctly passed to the handler?

Original comment by olikr...@gmail.com on 6 Jan 2013 at 8:17

GoogleCodeExporter commented 8 years ago
example ok

for the tutorial: How to display a cursor

Original comment by olikr...@gmail.com on 6 Jan 2013 at 9:20

GoogleCodeExporter commented 8 years ago

todo
- for touch screen: focus must be disabled when no element has been machted
   --> m2_DisableFocus() --> could be called by the handler
     auto enable for normal button events??
- write tutorial
- create example with event source

Original comment by olikr...@gmail.com on 6 Jan 2013 at 12:34

GoogleCodeExporter commented 8 years ago
Idea:
Two basic touch screen modes:
1) TSE Mode 'T'ouch 'S'creen sensitive 'E'lements: Normal elements can be 
selected by the touch screen. Detailes are controlled by the 't' flag.
2) TSK Mode 'T'ouch 'S'creen 'K'ey press simulation: Special touch screen 
elements emulate key press events: M2_TSK(<name>, <fmt>, <label>), 
M2_XBMTSK(<name>, <fmt>, x, y, bitmap), new format option "k" which contains 
the Key event number

1) --> almost implemented, but event handler needs to be renamed
2) --> new event handler, new elements

Original comment by olikr...@gmail.com on 6 Jan 2013 at 4:46

GoogleCodeExporter commented 8 years ago
TSK and TSE mode can use the same event handler. The event handler can 
distinguish the element based on the "k" format option, however:
--> ToDo: Remove "t" defaults to one for the exiting elements.

Application:
TSK Mode: Complex data entry, numbers and text
  --> Existing menues can be used, just a tool bar needs to be added
  --> pure ts handler does not work (key events are generated)
TSE Mode: Simple selectons or simple numeric data entry ( + num - )
  --> requires special designed dialog menues
  --> pure ts handler can be used

Original comment by olikr...@gmail.com on 6 Jan 2013 at 5:14

GoogleCodeExporter commented 8 years ago
'k' option implemented into the FindByXY procedures (m2->element_focus)

if k is set: copy element to m2->element focus
if t is set: update normal focus

M2_TSK: fn implemented, but object not yet defined
TODO:
- Remove "t" defaults to one for the exiting elements.
- Finish M2_TSK, create M2_XBMTSK
- create TSK Mode example, testing

Original comment by olikr...@gmail.com on 6 Jan 2013 at 9:43

GoogleCodeExporter commented 8 years ago
M2_TSK and M2_TSKP added
TODO:
- Remove "t" defaults to one for the exiting elements.
- create M2_XBMTSK
- create TSK Mode example, testing
- create touch screen tutorial

Original comment by olikr...@gmail.com on 7 Jan 2013 at 10:01

GoogleCodeExporter commented 8 years ago

Reported by project member olikraus, Jan 4 (6 days ago)

add a procedure which returns the element (or elements) which are under a given 
(x/y) position

Delete comment
Comment 1 by project member olikraus, Jan 4 (5 days ago)

find_by_xy() added (m2draw.c)
actions are not yet fully implemented (select msg)

Delete comment
Comment 2 by project member olikraus, Jan 4 (5 days ago)

select strategy touch screen:
1) x/y available: find element, if found: set focus & set flag, if not found: 
remove focus & clear flag
2) x/y not available & flag is set: clear flag and send select message to 
element

select strategy with mouse control:
1) x/y available: find element and set focus
2) Mouse button == select pin

introduce new option "t" for touch screen 

Delete comment
Comment 3 by project member olikraus, Jan 5 (5 days ago)

read only flag overrides 't' flag: change touch screen focus only if 'r' is 
zero and 't' is one

Status: Started
Delete comment
Comment 4 by project member olikraus, Jan 5 (5 days ago)

todo
- expand queue to support x/y values
- create new event handler (ehts, maybe eh4bsts which supports both)
- provide example code for new event source

Delete comment
Comment 5 by project member olikraus, Jan 5 (4 days ago)

todo
- expand queue to support x/y values --> DONE
- create new event handler (ehts, maybe eh4bsts which supports both) 
    --> Still pending
- provide example code for new event source
- do initial test with sdl example

Delete comment
Comment 6 by project member olikraus, Jan 6 (4 days ago)

sdl example still not working --> x/y not correctly passed to the handler?

Delete comment
Comment 7 by project member olikraus, Jan 6 (4 days ago)

example ok

for the tutorial: How to display a cursor

Delete comment
Comment 8 by project member olikraus, Jan 6 (4 days ago)

todo
- for touch screen: focus must be disabled when no element has been machted
   --> m2_DisableFocus() --> could be called by the handler
     auto enable for normal button events??
- write tutorial
- create example with event source

Delete comment
Comment 9 by project member olikraus, Jan 6 (4 days ago)

Idea:
Two basic touch screen modes:
1) TSE Mode 'T'ouch 'S'creen sensitive 'E'lements: Normal elements can be 
selected by the touch screen. Detailes are controlled by the 't' flag.
2) TSK Mode 'T'ouch 'S'creen 'K'ey press simulation: Special touch screen 
elements emulate key press events: M2_TSK(<name>, <fmt>, <label>), 
M2_XBMTSK(<name>, <fmt>, x, y, bitmap), new format option "k" which contains 
the Key event number

1) --> almost implemented, but event handler needs to be renamed
2) --> new event handler, new elements

Delete comment
Comment 10 by project member olikraus, Jan 6 (4 days ago)

TSK and TSE mode can use the same event handler. The event handler can 
distinguish the element based on the "k" format option, however:
--> ToDo: Remove "t" defaults to one for the exiting elements.

Application:
TSK Mode: Complex data entry, numbers and text
  --> Existing menues can be used, just a tool bar needs to be added
  --> pure ts handler does not work (key events are generated)
TSE Mode: Simple selectons or simple numeric data entry ( + num - )
  --> requires special designed dialog menues
  --> pure ts handler can be used

Delete comment
Comment 11 by project member olikraus, Jan 6 (3 days ago)

'k' option implemented into the FindByXY procedures (m2->element_focus)

if k is set: copy element to m2->element focus
if t is set: update normal focus

M2_TSK: fn implemented, but object not yet defined
TODO:
- Remove "t" defaults to one for the exiting elements.
- Finish M2_TSK, create M2_XBMTSK
- create TSK Mode example, testing

Delete comment
Comment 12 by project member olikraus, Jan 7 (2 days ago)

M2_TSK and M2_TSKP added
TODO:
- Remove "t" defaults to one for the exiting elements.
     --> DONE
- create M2_XBMTSK
- create TSK Mode example, testing
     --> SDL
- create touch screen tutorial

Original comment by olikr...@gmail.com on 10 Jan 2013 at 9:12

GoogleCodeExporter commented 8 years ago
think about replacing the "k" flag with a struct member uint8_t
"t" is then set by the TSK elements.
todo (A) check if "t" and "k" are the always treated the same way (B) update 
code: TSK sets "t" flag, then (C) update code: remove "k" flag and replace by 
struct member

Original comment by olikr...@gmail.com on 15 Jan 2013 at 8:12

GoogleCodeExporter commented 8 years ago
k flag has been removed from draw procedure
t and r are set by default for M2_TSK and M2_TSKP
todo:
- change struct for TSK element
- implement XBMTSK
- finish tutorial

Original comment by olikr...@gmail.com on 17 Jan 2013 at 8:59

GoogleCodeExporter commented 8 years ago
tsk struct introduced, new key member added, sdl example updated
todo
- implement XBMTSK
- finish tutorial

Original comment by olikr...@gmail.com on 28 Jan 2013 at 10:55

GoogleCodeExporter commented 8 years ago
the event source handling has been rewritten:
New event is
M2_KEY_EVENT(M2_KEY_TOUCH_PRESS)  - no debounce
or
M2_KEY_TOUCH_PRESS    - internal debounce algorithm
Event source should return TOUCH PRESS as long as the touch screen detects 
preasure.
Select is generated after relese from touch screen (KEY_NONE returned)
todo
- implement XBMTSK
- finish tutorial

Original comment by olikr...@gmail.com on 31 Jan 2013 at 11:09

GoogleCodeExporter commented 8 years ago
M2_XBMTSKP added, but not yet tested

Original comment by olikr...@gmail.com on 5 Feb 2013 at 11:39

GoogleCodeExporter commented 8 years ago
M2_XBMTSKP fixed & tested
todo:
- documentation
- examples

Original comment by olikr...@gmail.com on 15 Feb 2013 at 9:11

GoogleCodeExporter commented 8 years ago
example TouchPanel added, but event handler not yet updated
--> takeover from sdl example

Original comment by olikr...@gmail.com on 23 Mar 2013 at 10:16

GoogleCodeExporter commented 8 years ago
examples almost finished, but typedef needs to be removed

Original comment by olikr...@gmail.com on 24 Mar 2013 at 6:38

GoogleCodeExporter commented 8 years ago
glcd example added to release

Original comment by olikr...@gmail.com on 1 Apr 2013 at 3:13

GoogleCodeExporter commented 8 years ago
todo: review wiki page

Original comment by olikr...@gmail.com on 1 Apr 2013 at 3:45

GoogleCodeExporter commented 8 years ago
wiki page updated...

Original comment by olikr...@gmail.com on 1 Apr 2013 at 8:06