Skip to content

drag doesn't track "start of drag" as distinct from "mid drag" #87

@sboosali

Description

@sboosali

@minimapletinytools seems to have implemented this in tinytools-vty:

data DragState = DragStart | Dragging | DragEnd

data Drag2 = Drag2
  { …
  , _drag2_state :: DragState
  }

drag2 =
  …
  V.EvMouseDown x y btn' mods'
          | state == DragEnd && btn == btn' -> Just $ Drag2 (x,y) (x,y) btn' mods' DragStart
          | state /= DragEnd && btn == btn' -> Just $ Drag2 from (x,y) btn mods' Dragging
          | otherwise
  …

https://github.com/minimapletinytools/tinytools-vty/blob/potato/src/Potato/Reflex/Vty/Widget.hs#L183

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions