Set Caps and Num lock from within X?

Hello,
Not sure if this is the right place to post it but..
I have a requirement to set Caps lock and/or Num lock on and off via a Cron job.
Now I have working scripts that do the job, but as soon as X starts up the jobs no longer run (well they appear to, but Caps lock and Num lock do not toggle).
Is there a way to acheive this when X is running?
The OS is a couple of versions of Fedora (cersions depend on the hardware type)

In case you are wondering why, this is a display application using browsers, there is no keyboard as such, and Caps and Num locks are used to indicate status etc.