BLE MIDI & Keystroke


I’m making foot pedal for playing guitar with IPAD.
Most of functions have been solved, but I want to add one more function and need your advice~
Please check below summary and give your advice ^^

there are 6 buttons and each have MIDI note.
For button 5 and 6 can be used long press and it make change MIDI notes for all buttons.
As a result, I can make 12 MIDI notes by 6 buttons.-assign required function in IOS App.

Now I want to use button 5 & 6 for page turner.
Unfortunately, App do not support MIDI notes to control.
Hence I need to send keystroke as “LEFT ARROW” and “RIGHT ARROW” as qwerty keyboard command.
I put some more coding, but only keystroke is working and MIDI can not be used.
I think some of library has been conflicted and “Blekeyboard.h” has higher priority and make this happen.

Could you let me know how to solve this issue?
Is it really impossible to send both MIDI and Keystroke in 1 arduino ?

Thank you.

BIRD_FOOT_V3_with_page_turner.ino (10.1 KB)