There already is a command that does exactly this "focused behaviour"Any user can go to there keymap, and reassign F7/F8 to the focus sensitive command. https://wiki.freepascal.org/IDE_Window:_Assembler#Using_the_same_or_different_keys_for_Pascal_and_ASM_steppingAssign F7/F8 to the marked entries of the keymap