Add Support for F17-24 Keys


#1

Bit of an odd request but would it be possible to add support for F17-24 keys please? Currently they stop at F16.
I’ve got a user with an old Sony CCTV controller who’s using it as a control surface for Waveform: https://www.kvraudio.com/forum/viewtopic.php?f=22&t=489889&p=6859045#p6859045


#2

This is also relevant for users with USB Apple keyboards which go up to F19. It should be easy to add for some platforms at least.

OSX goes up to NSF35FunctionKey in the header, Linux goes up to XK_F35, Windows 10 definitely goes to VK_F24.

Android seems not to support it. F12 at highest.(https://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_F12)

No idea about iOS as I can’t find a header where the button codes are defined.


#3

OK. This is fixed on develop with commit 768163f.


#4

Thanks for this Fabian. One small thing is that I don’t think F keys are restored correctly from a KeyPress. If you take a look at KeyPress::createFromDescription, the for loop that deals with the function keys goes from 1 to 12 inclusive.

It looks like this needs to deal with the higher keys and possibly their non contiguous numbering?

It’s very late at the moment but does this make sense?

        // see if it's a function key..
    if (! desc.containsChar ('#')) // avoid mistaking hex-codes like "#f1"
    {
        for (int i = 1; i <= 35; ++i)
        {
            if (desc.containsWholeWordIgnoreCase ("f" + String (i)))
            {
                if (i <= 16)        key = F1Key + i - 1;
                else if (i <= 24)   key = F17Key + i - 17;
                else if (i <= 35)   key = F25Key + i - 25;
            }
        }
    }

?


#5

Thanks, this will appear on develop shortly.


#6

Thanks!