There are some moments or areas where we do not want the touch performed in the same way. Therefore, we can grab some inputs to give them special treatment.
We will continue working with the touch profile, so it could be useful to review the previous recipes for a deeper understanding, also we will use the same KV file with the common button and label widgets whereby you will find a detailed explanation of the KV file in the recipe Recognizing touch shapes.
This recipe following the next steps:
In the KV file, define a button and a empty label:
<MyW>: Button: id: button1 pos: 0,0 text: 'Hello' Label: id: label1 pos: 200, 200 text: ''
In the class of the widget in the Python code, we need to override the method
on_touch_down
.If the touch coincides with the button area, grab the touch.
In the class of the widget in the Python code, we also need to override the method
on_touch_up
.If the...