Detecting F keys

59 views
Skip to first unread message

Mario Emmanuel

unread,
Sep 28, 2023, 4:50:39 PM9/28/23
to Harbour Users
What is the right way to determine if user has pressed function keys?

This is what I have tried:

    DO WHILE .T.
        nChoice := INKEY(0)
        DO CASE
            CASE nChoice == K_F1
                HandleHelp()
            CASE nChoice == K_F2
                // Handle Cancel
                EXIT
            CASE nChoice == K_F3
                // Handle Save
                EXIT
            OTHERWISE
                // Handle other keys
        ENDCASE
    ENDDO

I get Error BASE/1003 Variable does not exist: K_F1, which I understand it is because Harbour is not recognising K_F1 as a valid constant. Shall I include something to get those ones recognised?

Thanks

pete....@gmail.com

unread,
Sep 28, 2023, 5:19:45 PM9/28/23
to Harbour Users
#include "inkey.ch"

regards,
Pete
Reply all
Reply to author
Forward
0 new messages