0

I am writing a Kivy application where I want to select a Region Of Interest (ROI) on a scatter image widget. I want to identify when the user presses CTRL+Left Click and then draw a rectangle over the image. Is it possible from within the on_touch_down callback to identify that the user is holding the CTRL button?

Thanks, Amit

Amit
  • 1
  • 1
    I think you need to bind to Window.on_key_down and Window.on_key_up and maintain your own set of currently pressed keys. I think the window implementations keep a limited list internally but don't expose it. – inclement Mar 19 '15 at 00:58
  • Thanks, I am aware of the [question](http://stackoverflow.com/questions/17280341/how-do-you-check-for-keyboard-events-with-kivy?rq=1). I am wondering if there is a simpler more straight forward way to do this, – Amit Mar 19 '15 at 01:04
  • Combine the events `on_key_down`, `on_key_up` with `on_mouse_move` to calculate the diagonal of your rectangle. You can then draw it, and perform other actions following `on_touch_up`. – Patrick McLaren Mar 19 '15 at 01:06
  • 1
    I noticed that the Window actually has a `modifiers` property that in principle should contain this. – inclement Mar 26 '15 at 11:12

0 Answers0