added tmkgetevd and tmkwaitevents