The key to switch between Full Keyboard Mode and Partial Keyboard Mode is preset to Scroll Lock. If you want to map it to another key, simply define the uimodekey property in mame.ini.

Setting in mame.ini

...
#
# OSD KEYBOARD MAPPING OPTIONS
#
uimodekey ENTER_PAD

This would change the menu key to the Enter key on the number keypad. You can choose any key from this set:

A, B, C, D, E, F, G, H, I,
J, K, L, M, N, O, P, Q, R, 
S, T, U, V, W, X, Y, Z, 0,
1, 2, 3, 4, 5, 6, 7, 8, 9,
F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12, F13, F14, F15, ESC,
TILDE, MINUS, EQUALS, BACKSPACE, TAB, OPENBRACE, 
CLOSEBRACE, ENTER, COLON, QUOTE, BACKSLASH, BACKSLASH2,
COMMA, STOP, SLASH, SPACE, INSERT, DEL, HOME,
END, PGUP, PGDN, LEFT, RIGHT, UP, DOWN,
0_PAD, 1_PAD, 2_PAD, 3_PAD, 4_PAD, 5_PAD, 6_PAD,
7_PAD, 8_PAD, 9_PAD, SLASH_PAD, ASTERISK, MINUS_PAD,
PLUS_PAD, DEL_PAD, ENTER_PAD, PRTSCR, PAUSE, LSHIFT,
RSHIFT, LCONTROL, RCONTROL, LALT, RALT, SCRLOCK,
NUMLOCK, CAPSLOCK, LWIN, RWIN, MENU, CANCEL

If you do not yet have a mame.ini file in your folder, run MAME with the -createconfig option from a command shell:

mame -createconfig

Command line option

As with all settings in mame.ini, you can also provide this setting in the command line:

mame64 ti99_4a -uimodekey ENTER_PAD