kengineer Posted July 28, 2016 Report Posted July 28, 2016 I was just wondering what the proper way is to default my system to finger mode for the GINPUT/mouse input. I know there is a function call to put it into finger mode, but I'm wondering how to default it to do this properly that way it is done before it reaches the calibration screen (which is called by gfxInit). I could put the call inside the LoadMouseCalibration function but wanted to know if there's a better way to do this.
Joel Bodenmann Posted July 28, 2016 Report Posted July 28, 2016 There's a flag that you can put in your mouse driver for that: GMOUSE_VFLG_DEFAULTFINGER. Works like this: const GMouseVMT const GMOUSE_DRIVER_VMT[1] = {{ { GDRIVER_TYPE_TOUCH, GMOUSE_VFLG_TOUCH|GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_DEFAULTFINGER, sizeof(GMouse) + GMOUSE_MCU_BOARD_DATA_SIZE, _gmouseInitDriver, _gmousePostInitDriver, _gmouseDeInitDriver }, ..., ... }};
kengineer Posted July 28, 2016 Author Report Posted July 28, 2016 Hi Joel, Yeah I saw that, but this would require modifying the graphics library code since it resides within the driver and not the board file (I could pull it out of the library I guess).
kengineer Posted July 28, 2016 Author Report Posted July 28, 2016 I suppose I could also just call ginputSetFingerMode within the init_board function in the MCU driver board file or set the flags from the mouse object pointer passed.
inmarket Posted July 29, 2016 Report Posted July 29, 2016 Yes that approach should work. The vmt flag is really designed for touch devices that are more than likely going to be used with finger. We should probably add a gfxconf setting for defaulting to finger for every other situation.
kengineer Posted July 29, 2016 Author Report Posted July 29, 2016 (edited) A very similar issue I found is the ability to setup extreme coordinate calibration, it doesn't exist without modifying those flags in the graphics library. The wiki claims it can be enabled by setting: #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR TRUE However, I don't see how this can be the case as this define is not referenced anywhere in uGFX library code other than in a board file (where it doesn't appear to be utilized). This would require the user to set the flags in that same location. A suggestion I would have would be to avoid all of these and similar situations, is to create a single #define for the flags used by the VMT in gmouse_lld_MCU that is defaulted (via ifndef) to the curent flags that are set now. Then the user if they so desire could add a #define to define the flags to their liking. Edited July 29, 2016 by kengineer
Joel Bodenmann Posted July 29, 2016 Report Posted July 29, 2016 We're sorry about the confusion with GINPUT_MOUSE_MAX_CALIBRATION_ERROR. That's a relic from an earlier/previous version of the GINPUT module. We'll look into it and clean-up / update the wiki accordingly. Please excuse the inconvenience.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now