Skip to content
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

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

Open
sboosali opened this issue Oct 21, 2024 · 0 comments
Open

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

sboosali opened this issue Oct 21, 2024 · 0 comments

Comments

@sboosali
Copy link

sboosali commented Oct 21, 2024

@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

@sboosali sboosali changed the title @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 … (Although, I dunno if they use it, but .) https://github.com/minimapletinytools/tinytools-vty/blob/potato/src/Potato/Reflex/Vty/Widget.hs#L183 drag doesn't track "start of drag" as distinct from "mid drag" Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant