mirror of
https://github.com/bloeys/gopad.git
synced 2025-12-29 15:08:21 +00:00
Basic cursor
This commit is contained in:
5
main.go
5
main.go
@ -166,6 +166,11 @@ func (g *Gopad) Update() {
|
||||
g.showErrorPopup()
|
||||
}
|
||||
|
||||
if input.MouseClicked(sdl.BUTTON_LEFT) {
|
||||
x, y := input.GetMousePos()
|
||||
g.getActiveEditor().SetCursorPos(int(x), int(y))
|
||||
}
|
||||
|
||||
//Close editor if needed
|
||||
if input.KeyDown(sdl.K_LCTRL) && input.KeyClicked(sdl.K_w) {
|
||||
g.closeEditor(g.activeEditor)
|
||||
|
||||
Reference in New Issue
Block a user