If I use this code :
Code: Select all
SET KEY VK_F5 TO TestPro
But now my question :
How can I read in another part of my appliction to which function the F5-key is linked ?
Thank you.
Code: Select all
SET KEY VK_F5 TO TestPro
Code: Select all
#include "FiveWin.ch"
#command SET KEY <n> TO <proc> ;
=> SetKey( <n>, {|p, l, v| <proc>(p, l, v)} ) ;;
AddKey( <n>, <(proc)> )
memvar aKeys
function Main()
public aKeys := {}
SET KEY VK_F5 TO Test
MsgInfo( KeyProc( VK_F5 ) )
SET KEY VK_F5 TO Another
MsgInfo( KeyProc( VK_F5 ) )
return nil
function AddKey( nKey, cProc )
local nAt
if Len( aKeys ) == 0 .or. ( nAt := AScan( aKeys, { | a | a[ 1 ] == nKey } ) ) == 0
AAdd( akeys, { nKey, cProc } )
else
aKeys[ nAt ] = { nKey, cProc }
endif
return nil
function KeyProc( nKey )
local nAt := AScan( aKeys, { | a | a[ 1 ] == nKey } )
if nAt != 0
return aKeys[ nAt ][ 2 ]
endif
return ""
function Test()
return nil
function Another()
return nil