Maybe one day I'll get it right:
    s/wsmouse_input_sync()/wsmouse_input_sync(ms->sc_wsmousedev)/

On 09/07/2016 12:12 AM, Ulf Brosziewski wrote:
> Hi, I was a bit hasty, I should have mentioned that calling
> wsmouse_input_sync is required here. The equivalent of your
> code would would be this:
> 
> if (x != 0 || y != 0 || buttons != ms->sc_buttons) {
>       wsmouse_position(ms->sc_wsmousedev, x, y);
>       /* ignore proximity, it will cause invalid button 2 events */
>       if ((data[0] & 0xf0) != 0xc0)
>               wsmouse_buttons(ms->sc_wsmousedev, buttons);
>       wsmouse_input_sync();
> }
> 
> The WSMOUSE_INPUT macro - a substitute for the old wsmouse_input
> function - does include that call (see wsmousevar.h).
> 
> There is a set of functions for reporting input states:
> wsmouse_buttons, wsmouse_motion, wsmouse_position, wsmouse_touch,
> and wsmouse_mtstate (and the somewhat special wsmouse_set and
> wsmouse_mtframe). A driver can call them in any order, and it
> doesn't need to check whether there are deltas, wsmouse does
> this anyway. However, a frame must be finished by a call to
> wsmouse_input_sync. It is this function that generates the
> wscons events.
> 
> The new interface has been introduced in 6.0.
> 
> On 09/06/2016 09:00 PM, Frank Groeneveld wrote:
>> On Tue, Sep 06, 2016 at 02:19:28PM +0200, Ulf Brosziewski wrote:
>>> Just a remark on your use of the wsmouse interface (which isn't well
>>> known and documented yet): wsmouse_set is a function for uncommon
>>> cases. To report a pair of absolute coordinates use wsmouse_position,
>>> that is, instead of
>>>     wsmouse_set(ms->sc_wsmousedev, WSMOUSE_ABS_X, x, 0);
>>>     wsmouse_set(ms->sc_wsmousedev, WSMOUSE_ABS_Y, y, 0);
>>> you should use
>>>     wsmouse_position(ms->sc_wsmousedev, x, y);
>>> Likewise, for reporting the button state there is
>>>     wsmouse_buttons(ms->sc_wsmousedev, buttons);
>>> There is no need for the WSMOUSE_INPUT macro here.
>>
>> Seems like a cleaner API indeed, but those functions don't seem to work
>> for me. Both mouse movement and button reporting stop functioning when
>> replaced by those calls. How old is this API, might it be some outdated
>> sources on my side? Something else I'm doing wrong?
>>
>> Frank
>>
>>
> 
> 

Reply via email to