` Printed Icetips Article

Icetips Article



Templates: Set global alert keys (2)
1998-11-03 -- Bertus Viljoen
 
Newsgroups: topspeed.products.c4

Editors note:  Please note that some lines may wrap in the template code.

Here is it.

It is more for CW2.

#TEMPLATE(BertusViljoen,'Extention to add Global Hot keys to your Application')
#Extension(HotKeys,'Add Hotkeys to your application - Version 2'),APPLICATION
#Boxed('Application Hotkey Definition')
  #Prompt('Hotkeys',Keycode),%hotkeyname,Multi('Hotkeys'),Unique
  #Prompt('Procedures',Procedure),%HotProcedure,Multi('Procedures')
#EndBoxed
#AtStart
  #Declare(%ForCounter,Long)
#EndAt
#At(%WindowInitializationCode)
  #If (%Window)
    #For(%HotKeyName)
      %Window{Prop:Alrt,255} = %Hotkeyname
    #EndFor
  #EndIf
#EndAt
#AT(%EventCaseBeforeGenerated)
  #If (%Window)
    #Set(%ForCounter,1)
  OF EVENT:AlertKey
    Case Keycode()
    #For(%HotKeyName)
      #Select(%HotProcedure,%ForCounter)
    Of %HotKeyName
      Start(%HotProcedure,25000)
      #Set(%ForCounter,%ForCounter+1)
    #EndFor
     End
  OF EVENT:PreAlertKey
     ! Do Some Stuff
  #EndIf
#ENDAT



Printed May 3, 2024, 9:17 am
This article has been viewed/printed 35119 times.
Google search has resulted in 5 hits on this article since January 25, 2004.