Jump to content

Proper way to default to finger mode


kengineer

Recommended Posts

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.

Link to comment
Share on other sites

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
    },
    ...,
    ...
}};

 

Link to comment
Share on other sites

 

 

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 by kengineer
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...