TableListBox steals up & down arrows

It looks like TableListBox grabs the up and down arrow keys so they don’t show up in keyPressed() like the left & right arrows do.

Is there any way to get those key presses?

If I put a breakpoint in my TableListBox in keyPressed() it breaks on a Down or Up arrow

Rail

Did you subclass TableListBox?

I just added a TableListBox to my editor and made the editor a KeyListener. That’s where I get the left and right arrow presses and everything else, except up/down arrows and return.

Mine is a sub class.

bool CGroupTable::keyPressed (const KeyPress& key)
{
    m_iFirstGroup = getFirstGroup();
    m_iLastGroup  = getLastGroup();

    if (key.isKeyCode (KeyPress::homeKey) && m_iFirstGroup != -1)
        {
        scrollToEnsureRowIsOnscreen (0);
        selectRow (m_iFirstGroup);

        return true;
        }

    if (key.isKeyCode (KeyPress::endKey) && m_iLastGroup != -1)
        {
        scrollToEnsureRowIsOnscreen (m_pGroupArray->size() - 1);

        selectRow (m_iLastGroup);

        return true;
        }

    if (key.isKeyCode (KeyPress::rightKey) && (m_pPartTable != nullptr))
        {
        m_pPartTable->grabKeyboardFocus();

        return true;
       }

    return ListBox::keyPressed (key);
}

I don’t change the Up/Down behavior so they’re sent to the base class.

Rail

Thanks. Not sure why I didn’t think of subclassing it. Could be my Objective-C roots. :wink: