Automatic repeat of a key press
Posted: Sun Jan 10, 2021 8:28 pm
I wanted to make a program that would automatically repeat sending the code of the pressed key to the keyboard buffer. Expected effect of the program: a string of repeated characters appears in an open text editor. Or in the game, the character jumps a given number of times (for example). But it doesn't work yet
PROCEDURE AppSys
// Рабочий стол остается окном приложения
RETURN
********************************************************************************
FUNCTION Main()
LOCAL GetList[0], GetOptions, nColor, oMessageBox, oMenuWords, oDlg, n := 0, oPrinter
DC_IconDefault(1000)
DC_SpawnURL( 'http://rocket2009.byethost22.com/index.php', .T., .T. ) // Отметка на сайте о запуске программы
SET DECIMALS TO 15
SET DATE GERMAN
SET ESCAPE On
CrLf = CHR(13)+CHR(10) // Конец строки (записи) DOS, WINDOWS
********************************************************************
mKey = 'W '
mRep = 10
@1, 1 DCGROUP oGroup1 CAPTION 'Задание клавиши и числа повторов' SIZE 42.0, 3.5
@1,2 DCSAY "Задайте клавишу:" PARENT oGroup1
@1,30 DCSAY "" GET mKey PICTURE "XXXXXXX" PARENT oGroup1
@2,2 DCSAY "Задайте число повторов:" PARENT oGroup1
@2,30 DCSAY "" GET mRep PICTURE "#######" PARENT oGroup1
DCREAD GUI;
TO lExit ;
FIT;
ADDBUTTONS;
MODAL;
TITLE '(c) Повтор нажатия клавиши'
IF lExit
** Button Ok
ELSE
QUIT
ENDIF
********************************************************************
aKey := {}
FOR j=1 TO mRep
AADD(aKey, ASC(mKey))
NEXT
DC_PutKey(aKey)
LB_Warning('Выполнено')
RETURN NIL