Using Datapack to make Keybinds

Is there any possible way to create keybinds for datapack, i want like when i press the A button it runs a function or even a command is okay, or when i Left Click or Right Click it runs a function and also making it work for Ctrl and shift? I am beginner to datapacks creation is there any way?
Continue to help post