Merge pull request #46 from thehabbos007/button-constants

Got rid of custom x11 button constants
pull/47/head
Alexey Kutepov 5 years ago committed by GitHub
commit 77c3372a77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,12 +76,6 @@ proc draw(screenshot: Image, camera: var Camera, shader, vao, texture: GLuint) =
glBindVertexArray(vao)
glDrawElements(GL_TRIANGLES, count = 6, GL_UNSIGNED_INT, indices = nil)
# TODO(#29): get rid of custom X11 button constants
const
LEFT_BUTTON = 1
WHEEL_UP = 4
WHEEL_DOWN = 5
proc main() =
var config = defaultConfig
let configFile = block:
@ -287,14 +281,14 @@ proc main() =
of ButtonPress:
case xev.xbutton.button
of LEFT_BUTTON:
of Button1:
mouse.prev = mouse.curr
mouse.drag = true
of WHEEL_UP:
of Button4:
camera.deltaScale += config.scrollSpeed
of WHEEL_DOWN:
of Button5:
camera.deltaScale -= config.scrollSpeed
else:
@ -302,7 +296,7 @@ proc main() =
of ButtonRelease:
case xev.xbutton.button
of LEFT_BUTTON:
of Button1:
mouse.drag = false
else:
discard

Loading…
Cancel
Save