You can type out the "/cast SPELL", but you may find it a bit flaky, especially if you are hitting any other keys while hitting the X-Key button. You are much better off programming the X-Keys with a specific key and then using the keybinding in game to bind the programmed X-Keys button to an action bar. You can of course use the standard 1 through =, but by using the X-Keys pad, you can use some key combinations that you would not normally use such as ctrl+alt+shift+KEY that would be awkward to actually press.