Empire
Empire copied to clipboard
osx prompt and keylogger lang issue
the osx prompt and keylogger work fine, except one important thing which is the following: the keyboard layout isn't taken into account so while the key pressed returned might be correct on a default US keyboard I presume, on another one it isn't It's quite easy to "translate" for simple key like a > q but some combos like @ on some keyboards are very different. that command return the layout used but I fail to find a way to properly translate what Empire returns given the layout any idea ?
defaults read /Library/Preferences/com.apple.HIToolbox.plist AppleEnabledInputSources
(
{
InputSourceKind = "Keyboard Layout";
"KeyboardLayout ID" = 251;
"KeyboardLayout Name" = "ABC-AZERTY";
}
)
@euri10 I don't have the slightest idea how we would be be able to account for a non-US layout.
I read quite extensively about that in my holidays, it's a tricky subject.
It seems to me that the below library solves the issue, in particular here where it maps the key codes to the layout https://github.com/boppreh/keyboard/blob/master/keyboard/_darwinkeyboard.py#L136
But I need to test it a little before I could have a definite judgment.