#37339 - 2003-03-06 11:30 AM
Re: Test for keypress for a specific Time - then continue
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
Hi!
My final solution (as final as software can be )
Altered a little bit, so if you press "p" the script will be paused and if you press any other key, the loop is exited directly without waiting.
Luziekix
code:
$ypos=1 ? "Hit any key to cancel" while $key = " " AND $count < 5 ; ca. 5 seconds sleep 1 $count = $count + 1 $=sendkeys(" ") get $key AT(3,$ypos)"." $ypos = $ypos + 1 loop IF $key="p" ? "PAUSED - Press any key to continue" get $ get $ ENDIF
|
|
Top
|
|
|
|
#37341 - 2003-03-06 04:44 PM
Re: Test for keypress for a specific Time - then continue
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
O.K. Jochen,
I see - my "last" version has some things to improve
However I wonder, why itīs running well with KIX v3.63 but not with v4.20 (where it just simple quits instead of waiting 5 Seconds in the loop).
Any clue ?
Luziekix
|
|
Top
|
|
|
|
#37342 - 2003-03-07 01:01 AM
Re: Test for keypress for a specific Time - then continue
|
Taurendil
Lurker
Registered: 2003-03-07
Posts: 1
|
On the same topic, can anyone explain me while this isn't working for me. I'm writing a script that runs an eternal loop. Once each loop I want a 5 second period in which the user can cancel by pressing any key. (seems very similar to the original question.) This is what i wrote: . For $counter = 1 to 100 . Sleep 0.05 . If KbHit() . Quit . Endif . Next The script does pause for 5 seconds, but doesn't accept any input from me; what am I doing wrong? (I'm using version 4.20)
_________________________
- Impotent man looking for frigid woman to sit around and do nothing.
|
|
Top
|
|
|
|
#37345 - 2003-03-12 11:12 AM
Re: Test for keypress for a specific Time - then continue
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
Hi Sealeopard!
SHELL "MODE CON COLS=80 LINES=25"
donīt seem to work.
(The window still has the default 300 lines).
Have you tested it ?
The UDF I will try today.
Regards,
Luzie
|
|
Top
|
|
|
|
#37347 - 2003-03-13 05:01 PM
Re: Test for keypress for a specific Time - then continue
|
BBSOFT
Lurker
Registered: 2003-02-24
Posts: 4
|
However, the above works on Kix v4 (which I recommend you to upgrade to, so we all have the same versions and functions)
On Kix v3 we can use the values directly without Hex-to-Dez-Conversion:
$key="__Server-Name_NETLOGON_KIX32.EXE" $Err=AddKey("HKEY_CURRENT_USER\Console\"+$key) $err=writevalue("HKEY_CURRENT_USER\Console\"+$key,"screenbuffersize","500019","REG_DWORD")
Take care about the two "_" before the Server-Name, this is needed !
And: The above is first active on the second Logon !
BBSOFT [ 18. March 2003, 08:57: Message edited by: BBSOFT ]
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 937 anonymous users online.
|
|
|