Topic: Reading keyboard shift status (1 of 8), Read 26 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Wednesday, June 30, 2004 12:34 PM

Is there a way to read keyboard status without stopping to wait for keypress? Something similar to INKEY$ function in Basic?


Especially, I would need to read the status of Shift / Ctrl / Alt keys (on Mouse double-click event macro).


I tried the following:

#100 = 0x0200
Sys_Int(0x16)
if (#100 & 4) { // Ctrl key pressed
...


but it generates an error "INVALID COMMAND: Sys_Int(0x16)".


I guess Sys_Int does not work in Windows (XP)? Anyway, there is not mention of this in the documentation.


--
Pauli

 


Topic: Re: Reading keyboard shift status (2 of 8), Read 21 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Wednesday, June 30, 2004 09:30 PM

At 12:30 PM 6/30/2004, you wrote:
>Is there a way to read keyboard status without stopping to wait for keypress? Something similar to INKEY$ function in Basic?
>
>Especially, I would need to read the status of Shift / Ctrl / Alt keys (on Mouse double-click event macro).

Incredibly, we don't have this status available in the macro language. Since it is available internally, it will be trivial to add. I will send you a preliminary version in a few days.

Ted.

 


Topic: Re: Reading keyboard shift status (3 of 8), Read 22 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Thursday, July 01, 2004 09:36 PM

At 12:30 PM 6/30/2004, you wrote:
>Is there a way to read keyboard status without stopping to wait for keypress? Something similar to INKEY$ function in Basic?
>
>Especially, I would need to read the status of Shift / Ctrl / Alt keys (on Mouse double-click event macro).

I have implemented the new command Key_Shift_Status with the following return values:

Mask 40 = Caps Lock
Mask 20 = Num Lock
Mask 10 = Scroll Lock
Mask 08 = Either Alt key
Mask 04 = Either Ctrl key
Mask 02 = Either Shift key
Mask 01 = Undefined

The new vpw.exe dated 07/01/2004 can be downloaded from:

http://www..../download/vpw.exe


To test it, enter this command:

repeat(all) { $KeyShiftStatus Sleep }

Then press the various keys. Then Ctrl-C to stop the macro.

Enjoy and knock yourselves out. ;-)

Ted.

 


Topic: Re: Reading keyboard shift status (4 of 8), Read 22 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Sunday, July 04, 2004 10:27 AM

On 7/1/2004 9:36:26 PM, Ted Green wrote:
>
>I have implemented the new command Key_Shift_Status with
>the following return values:

Thanks, Ted. It works fine.
I used it on my search116.vdm event macro.

It is the double-click event macro for wild search wizard.
If you are viewing the search results, you can double-click a line to immediately go to the correct position on that file.
If you are in any other file, double-clicking highlights a word, as normally.

In the new version, if you double-click on a word that is already highlighted, the entire line is highlighted.
This is the function that triple-click performs in many programs.
(How about implementing triple-click on Vedit?)

If you press shift key when double-clicking, the entire paragraph is highlighted.
In many programs, this is done with ctrl-double-click. However, on Vedit, this would clash with the normal operation of ctrl-key, so I used Shift key instead.

You can download the macro from
http://koti.mbnet.fi/pkl/tmp/search116.vdm

There is a little problem: if you try to use this macro with Vedit version that does not support Key_Shift_Status,
the macro will stop with an error message. I guess I will have to check for version number >612. (Currently, the check is for >=612 so that it can be tested with the version Ted posted above).

--
Pauli

 


Topic: Re: Reading keyboard shift status (5 of 8), Read 24 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, July 06, 2004 04:17 AM

At 10:28 AM 7/4/2004, you wrote:
>There is a little problem: if you try to use this macro with Vedit version that does not support Key_Shift_Status,
>the macro will stop with an error message. I guess I will have to check for version number >612. (Currently, the check is for >=612 so that it can be tested with the version Ted posted above).

I changed the version number to 6.13 and placed the new vpw.exe file at:

http://www..../download/vpw.exe

Please note that this is a preliminary 6.13 and other enhancements and fixes will be made before 6.13 is "released".

Ted.


Ted.
-------------------------------------------------------------------------
Ted Green (ted@...) Greenview Data, Inc.
Web: www.... PO Box 1586, Ann Arbor, MI 48106
Tel: (734) 996-1300 Fax: (734) 996-1308 VEDIT - Text/Data/Binary Editor
-------------------------------------------------------------------------
Spam problems? www.SpamStopsHere.com blocks 99% of spam for businesses.

 


Topic: Re: Reading keyboard shift status (6 of 8), Read 24 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, July 06, 2004 09:12 AM

On 7/6/2004 4:17:12 AM, Ted Green wrote:
>At 10:28 AM 7/4/2004, you
>wrote:
>>There is a little problem: if you try to use this macro with Vedit version that does not support Key_Shift_Status,
>>the macro will stop with an error message. I guess I will have to check for version number >612. (Currently, the check is for >=612 so that it can be tested with the version Ted posted above).
>
>I changed the version number to 6.13 and placed the new
>vpw.exe file at: http://www..../download/vpw.exe
>
>Please note that this is a preliminary 6.13 and other
>enhancements and fixes will be made before 6.13 is
>"released".


What do you think about the following enhancements:

Version_Num(EXTRA) Display/return the complete VEDIT version number (e.g. 6122 against the current 612)

Version_Date Display/return the date of the VEDIT version as number yyyymmdd: eg. 20040524

With these additional infos most version tests should be easily possible.


Christian

 


Topic: Re: Reading keyboard shift status (7 of 8), Read 22 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Wednesday, July 07, 2004 12:52 PM

At 09:13 AM 7/6/2004, you wrote:
>What do you think about the following enhancements:
>
>Version_Num(EXTRA) Display/return the complete VEDIT version number (e.g. 6122 against the current 612)
>
>Version_Date Display/return the date of the VEDIT version as number yyyymmdd: eg. 20040524

Christian:

Your command is my wish. :-) (Its a little play on the English words.)

The new vpw.exe is at:

http://www..../download/vpw.exe

Please note that before using these new commands, a macro may need to check that Version_Num >= 613.

In general, I update 3rd digit of the version number when there are any new commands or features. However, using beta-testing there is sometimes some confusion.

In other words, only use them when absolutely necessary.

Ted.

 


Topic: Re: Reading keyboard shift status (8 of 8), Read 22 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Wednesday, July 07, 2004 03:33 PM

On Wed, 07 Jul 2004 00:52:00 -0400, Ted Green wrote:

>>Version_Num(EXTRA)
>>Version_Date
>
>Christian:
>
>Your command is my wish. :-)

If only I would have known THAT earlier ... ;-)

Thanks for the new commands!


>In general, I update 3rd digit of the version number when there
>are any new commands or features.
>However, using beta-testing there is sometimes some confusion.

Yup.

>In other words, only use them when absolutely necessary.

Of course. It's only for some special macros.
Since all my macros are available via my website and perhaps are
executed by other users I want to make them safe.

Here and there after a new VEDIT is released I'll check those macros
and fix the version commands.


Christian