I'm sorry, I should have been more clear. This is for my Orpg project, I am using DGUI to create action bars, and I'm having difficulty finding a way to actually use them easily, i.e 1 through 0, but as it seems you cannot add units to control groups manually with Jass. So we are discussing an alternative to this.
Basically I want when you press a key linked to that action in the action bar it runs the code. Just like other MMO's. I though control groups would be perfect, and I can still use it, but it might be a hassle for players to constantly push cntrl when they add spells to the bar.
I was talking about F keys before because I had a system before that had the action bar be the Hero UI on the left side, and players could press f1 through f5 to use them. But I'm curious if you hide the UI can you still press f1 through f5 to select the "hero dummy" so I can call the code. If I can, I can just have dummy hero's linked to each action in the bar and players can use f1 through f10 to cast spells.