Add proper and reliable (i hope) support for modifier keys
This commit is contained in:
parent
8c28c57925
commit
ae514f5ae2
@ -45,7 +45,7 @@ func (application *Application) OnQuit (
|
|||||||
// OnPress registers an event handler to be called when a key or mouse button
|
// OnPress registers an event handler to be called when a key or mouse button
|
||||||
// is pressed.
|
// is pressed.
|
||||||
func (application *Application) OnPress (
|
func (application *Application) OnPress (
|
||||||
onPress func (button Button),
|
onPress func (button Button, modifiers Modifiers),
|
||||||
) {
|
) {
|
||||||
application.callbackManager.onPress = onPress
|
application.callbackManager.onPress = onPress
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,7 +91,9 @@ func (backend *Backend) handleButtonPress (
|
|||||||
backend.compressScrollSum(&sum)
|
backend.compressScrollSum(&sum)
|
||||||
backend.callbackManager.RunScroll(sum.x, sum.y)
|
backend.callbackManager.RunScroll(sum.x, sum.y)
|
||||||
} else {
|
} else {
|
||||||
backend.callbackManager.RunPress(stone.Button(buttonEvent.Detail + 127))
|
backend.callbackManager.RunPress (
|
||||||
|
stone.Button(buttonEvent.Detail + 127),
|
||||||
|
stone.Modifiers { })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||