This function works just great under Windows and Linux. Reread the docs on it - the order of the parameters is
set_keyboard_rate( int delay, int rate );
set_keyboard_rate(1000,0), as was your example, sets the delay to 1000ms but a repeat rate of 0 - that's disabled.
The repeat rate is "number of milliseconds between each key repeat"
Here's some examples -