In a message dated 21/11/2007 15:25:24 GMT Standard Time, [EMAIL PROTECTED] writes:
I'm looking to write a little utility to record keypresses as macros, if necessary assigning them to a hotkey or altkey for later use. Some processes mean repeated strings of keypresses, so it may be handy to record these keypresses and replay them later with an alt or hot key to avoid typing the same commands repeatedly. Anyone have any idea how best to go about achieving this? -- Dilwyn Jones _______________________________________________ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm What about checking for the position of the pointer to the current input key queue. Even if the same key is pressed repeatedly the position of the buffer pointer moves which each character input. I used this when I wrote my screen saver to check for repeatedly pressed keys. sv_keyq=PEEK_L(SystemVariableBase+76) : REM pointer to keyboard queue NewKey=CheckKeys DEFine FuNction CheckKeys LOCal KeyPress REMark Returns 1 for keypress and 0 for no keypress BufPos=PEEK_L(sv_keyq) BufPos2=PEEK_L(BufPos+12) : REM last key pressed IF BufPos2=OldPos : KeyPress=0 IF BufPos2<>OldPos : KeyPress=1 OldPos=BufPos2 RETurn KeyPress END DEFine CheckKeys The value in Bufpos might be usable to get the key combination, if not sv_arbuf could be peeked to get the value. Duncan _______________________________________________ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
