none
WEC7 change Touchscreen driver to indicate only changes RRS feed

  • Question

  • Hi,

    My touchscreen currently works like this ->

    When a PEN is down it gets coordinates.

    It reads coordinates untill PEN is up

    When PEN is up it will inform OS that it was released.

    I want to change it to work like this

    When PEN is down it will read coordinates and infrom OS

    While it is down, it will not read anything

    When its up just inform OS it was relased.

    Because I am not that good at driver development I ask you guys to give me a little help.

    Here is the CPP file -> http://pastebin.com/qZ0PAJ3z

    and .H file of driver -> http://pastebin.com/H09ZGqvV

    Can someone please help me with this, or just point me in right direction.

    Regards,

    Luka

    Wednesday, July 10, 2013 11:18 AM

Answers

  • Hi,

    I think driver should be able to figure out when it was released, it has interupt connected and when the line is down its pressed, and when up its released. 

    I will try to make something working, Tnx for the tips

    Ah, you're correct - that simplyfies things conciderably. I have now browsed through the code and you should be able to prevent it from periodically sampling touch data without much effort:

    If you look in "PDDTouchPanelGetPoint(...)", when the pen down is detected they modify the value of "s_TouchDevice.dwSamplingTimeOut". This variable is used in the IST's (PDDTouchIST(...) "WaitForSingleObject(...)". When the pen is down, WaitForSingleObject won't wait infinitely for the interrupt to occur but will time out after a short amount of time, triggering a new reading.

    Simply make sure "s_TouchDevice.dwSamplingTimeOut" is set to INFINITE when pen down is detected and I think you should be fine.


    Henrik Viklund | http://www.addlogic.se

    • Proposed as answer by HenrikViklund Friday, July 12, 2013 8:27 AM
    • Marked as answer by LukecPivk Monday, July 15, 2013 8:09 AM
    Thursday, July 11, 2013 11:48 AM

All replies

  • With "while it is down, it will not read anything", do you mean you don't want the driver to read touch data from the touch? The driver got to read the touch status upon each interrupt because otherwise it won't be able to figure out the touch point has been pressed or released after beeing held down...

    However, if you don't want the driver to report valid touch points upstream as long as the pen is down you could modify PDDTouchPanelGetPoint to mark samples when pen is held down with TouchSampleIgnore (i.e make sure *pTipStateFlags = TouchSampleIgnore).

    However, there are several drawbacks with how you want the touch to operate -the most obvious is the calibration routine that IIRC want several consecutive position readings from the same position -readings which now won't be reported upstream. You need to device a way of handle this if you venture down this path (if you need to calibrate the touch, that is...).


    Henrik Viklund | http://www.addlogic.se

    Thursday, July 11, 2013 8:17 AM
  • Hi,

    I think driver should be able to figure out when it was released, it has interupt connected and when the line is down its pressed, and when up its released. 

    I will try to make something working, Tnx for the tips

    Thursday, July 11, 2013 9:55 AM
  • Hi,

    I think driver should be able to figure out when it was released, it has interupt connected and when the line is down its pressed, and when up its released. 

    I will try to make something working, Tnx for the tips

    Ah, you're correct - that simplyfies things conciderably. I have now browsed through the code and you should be able to prevent it from periodically sampling touch data without much effort:

    If you look in "PDDTouchPanelGetPoint(...)", when the pen down is detected they modify the value of "s_TouchDevice.dwSamplingTimeOut". This variable is used in the IST's (PDDTouchIST(...) "WaitForSingleObject(...)". When the pen is down, WaitForSingleObject won't wait infinitely for the interrupt to occur but will time out after a short amount of time, triggering a new reading.

    Simply make sure "s_TouchDevice.dwSamplingTimeOut" is set to INFINITE when pen down is detected and I think you should be fine.


    Henrik Viklund | http://www.addlogic.se

    • Proposed as answer by HenrikViklund Friday, July 12, 2013 8:27 AM
    • Marked as answer by LukecPivk Monday, July 15, 2013 8:09 AM
    Thursday, July 11, 2013 11:48 AM