I want to detect where a pressed key physically is on a Mac keyboard. Looking at the keycode tells me the char etc. but not the location, which varies with language/keyboard layout. I'd need something like row indexes for the key.
I'm able to look at the keyboard layout language using this code:
TISInputSourceRef source = TISCopyCurrentKeyboardInputSource();
NSLog(@"localized name: %@", TISGetInputSourceProperty(source, kTISPropertyLocalizedName));
From which I could map location through building keycode location dictionaries for each language, but that could be a lot of work to cover most keyboards.
Any ideas for a shortcut?