Trapping ALT-1 in SLE

Trapping ALT-1 in SLE

Post by Anthony Smit » Wed, 14 Jun 2000 04:00:00



I am trying to trap the ALT1 to ALT9 keys in a SLE, I have it working but it
dosent work well as it only traps it if you press and release the keys
simeltaneously. Does anyone know a better way of doing this.
Here is my code,

METHOD Dispatch(oEvent) CLASS oSLESearch // SLE Class
 IF GetKeyState(VK_MENU) = 1       // User pressed the ALT Key
  SELF:Owner:SelectIndex(Val(CHR(oEvent:wParam)))
 ENDIF
RETURN SUPER:Dispatch(oEvent)

--
Good Software is a Process of Evolution,
it is not Created

Anthony Smith

instead of spam use Datamax to reply

 
 
 

Trapping ALT-1 in SLE

Post by Geoff Schalle » Wed, 14 Jun 2000 04:00:00


I already sent you this code. If you use this in the dispatch you will
indeed be able to trap ALT-1 etc used in the normal way:

FUNCTION ALT_ON () AS LOGIC STRICT
// if Left/Right required, use VK_LMENU and VK_RMENU
RETURN LOGIC(_CAST, _And(GetKeyState(VK_MENU), SHORT(_CAST, 0x8000)))

As always, this is only half the equation. What you are really doing is
testing for the "1" key in a keydown or somesuch. When you find the "1",
THEN you test for ALT-ON. Do it that way and it work as you expect.

HTH

Geoff


> I am trying to trap the ALT1 to ALT9 keys in a SLE, I have it working but
it
> dosent work well as it only traps it if you press and release the keys
> simeltaneously. Does anyone know a better way of doing this.
> Here is my code,

> METHOD Dispatch(oEvent) CLASS oSLESearch // SLE Class
>  IF GetKeyState(VK_MENU) = 1       // User pressed the ALT Key
>   SELF:Owner:SelectIndex(Val(CHR(oEvent:wParam)))
>  ENDIF
> RETURN SUPER:Dispatch(oEvent)

> --
> Good Software is a Process of Evolution,
> it is not Created

> Anthony Smith

> instead of spam use Datamax to reply


 
 
 

Trapping ALT-1 in SLE

Post by Anthony Smit » Wed, 14 Jun 2000 04:00:00


I am trying to trap the ALT1 to ALT9 keys in a SLE, I have it working but it
dosent work well as it only traps it if you press and release the keys
simeltaneously. Does anyone know a better way of doing this.
Here is my code,

METHOD Dispatch(oEvent) CLASS oSLESearch // SLE Class
 IF GetKeyState(VK_MENU) = 1       // User pressed the ALT Key
  SELF:Owner:SelectIndex(Val(CHR(oEvent:wParam)))
 ENDIF
RETURN SUPER:Dispatch(oEvent)

--
Good Software is a Process of Evolution,
it is not Created

Anthony Smith

instead of spam use Datamax to reply

 
 
 

1. ALT Key in SLE

I found the Solution. Here it is

METHOD Dispatch(oEvent) CLASS oSLESearch // SLE Class
 IF GetKeyState(VK_CONTROL) = 1  // User pressed the ALT Key
  // NB: dont change this line of Code, for some reason the function above
works like this and traps the ALT Key
  // even though I am looking for the VK_CONTROL ?!
  SELF:Owner:SelectIndex(Val(CHR(oEvent:wParam)))
  RETURN 0L
 ENDIF
RETURN SUPER:Dispatch(oEvent)

--
Good Software is a Process of Evolution,
it is not Created

Anthony Smith

instead of spam use Datamax to reply

2. Can't open .Net Project

3. Trapping Escape Key in SLE

4. folders in RMAIL- how?

5. Trapping the enter key from SLE

6. User account AT.NET

7. How to trap ENTER in SLE

8. Messenger and XP

9. Trapping ALT key in dddw

10. Trapping Control-Alt-Delete

11. Posted: Proposal for alt.lonworks.control @ alt.config

12. alt.binaries.comp-graphics, alt.graphics, comp.graphics.apps.pagemaker

13. to trap or not to trap