A macro perhaps that would execute with respect to the chosen key combination.
Suggest that you put together an idea or two in code, test, and post if you have a problem.
Do not know, either way, if your requirement is homework or not. Therefore, it is best that you show your work first and solicit help with respect to a specific problem.
Really cannot provide answers per se but people may provide a hint or two that you can work with....