Keyboard macros

I’m looking for a way to record and playback keyboard macros in X applications (KDE specifically). I’ve tried xmacrorec and **xmacroplay, **but after running them, my mouse and keyboard don’t respond properly (e.g. the left mouse button gets stuck in a “clicked” state) and I have to restart X. Any modern alternatives that work under KDE 4.5 and openSUSE 11.3?