R3 - key binding one 1 key to toggle pattern edit/mixer?

Is there any way to assign or make a key binding one 1 key to toggle pattern edit/mixer?

Yes, scripting.