What key code maps to external USB brightness up/down keys? I am writing a script and I need to figure out current key codes for brightness up and down with an external keyboard.

I know the standard for a MacBook is 107 and 113, though as soon as I connect a different bigger apple keyboard, those changes to 145 and 144.

I need to be able to get this information out of the terminal as I'm scripting things there.

Is this possible?
The 'System keys' don't seem to have a Key Code equivalent, they are actioned below the OS-level. Try Key Codes (freeware)