-
-
Notifications
You must be signed in to change notification settings - Fork 105
Stylus pressure #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rchee2018
wants to merge
13
commits into
maoschanz:master
Choose a base branch
from
rchee2018:stylus_pressure
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Stylus pressure #683
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Syntax error of several lines that end with `".` instead of `."`
- Different devices are reported by event.get_source_device(), depending on which device generated the event at the time. - Aiptek tablet was one of the devices reported. The device name was "Aiptek pen (0)" (same with pen or mouse). Another device reported was "SIGMACHIP usb mouse". - Device Gdk.AxisFlags.PRESSURE was confirmed for Aiptek pen. - Event Gdk.AxisUse.PRESSURE returns 0.0 for Aiptek pen. In contrast, the SIGMACHIP usb mouse returned None for that.
- Unable to consistently get stylus pressure. Initial pressure reporting not reproducible afterwards.
- Removed the TODO about how to add python dependency.
- Main code with gesture stylus is in image.py now. - Removed or commented duplicated ones previously added elsewhere.
- Removed GestureStylus-related code from main.py and image.py. - Reset tool_brush.py according to maoschanz's original code. - Must install evdev (by software manager) and libevdev (pip). - Updated dependency (libevdev) on meson.build. - Added aiptek_access.py to list of install (src/meson.build). Functions in aiptek_access.py are imported into tool_brush.py. It uses evdev to read Aiptek pen pressure. - Altered tool_brush.py to use aiptek_access.py functions when the device is an Aiptek tablet product. - Now able to sense Aiptek pen pressure. But discovered this is not enough for the stylus to be useful for controlling the brush tool. - The original code senses standard usb mouse motion, but not the motion event of the stylus or the tablet mouse. - The "motion_on_area" functions are not executed when the stylus or tablet mouse moves. This explains why strokes are not seen during stylus motion, but the strokes appear after stylus is lifted.
- Drawing app is supposed to take a pressure range 0.0-1.0. - The old Aiptek tablets likely reports a max value of 512 for stylus pressure.
- This allows the width variation of the line to show at the time of drawing, rather than when the pen stroke is complete.
- Made some changed that did not work. - Reverted to original. - Needed to do retab (on vim editor), hence different tabs and spaces compared to the original.
- Previously thought EV_ABS type has code 1 & 2 being x & y. Actually, code 0 & 1 are x & y, respectively.
- Wanted to stop drawing when pen motion stops. Attempted to do this by calculating the distance between the previous and the current cursor positions, and continue to process only if that passes an arbitrary threshold. - Did not work well, because of error about the index being out of range for width[i -1]. Tried to make changes to the code involving width[i - 1] but it seemed to cause more problems. - Therefore, "reverted" the code by commenting. This keeps a small record of what have been tried.
- Does not need evdev after all. - There remains the problem of brush continuing to draw after the pen is lifted off the tablet surface and hovering; or connecting the trace from the lift-off point when making next pen stroke.
- Removed evdev-related python codes including aiptek_access.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This code enables stylus pressure reading in brush tool.