Note painted as "down/on" even when released


#1

Hi all

I am in the process of building an Android version of an app that I have made for iOS. I use my own version of the juce_MidiKeyboardComponent in the app. When running the app on an Android device, the latest note that has been pressed on the midi keyboard, is painted as being down/on even after the key has been released. This is also the case when I run the Juce demo on the same Android device. I can see that a "note off" is being generated, but the note is still being painted as being down/on. Is this a known bug? If anyone has a fix I would really appreciate if it could be shared here, thanks.

Best regards

John


#2

Well, it's not really a "bug". If you imagine what's happening on a touch-screen, when the finger is released the note will go up, but will still be painted as having the mouse over it, because the virtual "mouse" that your finger controlled hasn't moved away. For a touch-screen you may need to tweak the keyboard so that it doesn't highlight keys when there's a mouse-over.


#3

Oh, ok thanks. I just assumed it was supposed to work as on my iOS devices.

best regards

John


#4

It does work on iOS, it was just never designed with a touch-screen in mind!


#5

Sorry if I am not being clear. I know it works on iOS, my point is that it works differently on my Android devices. On my iOS devices notes are not being painted as being down/on when I release the note (lift the finger from the screen). 

Best regards

John


#6

They both handle touches slightly differently - perhaps on iOS the native code sends a mouse-move that pretends to move the cursor off-screen, I don't remember exactly.