- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the following procedure (from Mr. Lawrence's book) to asign some hotkey's to the menu in my Quickwin application (listed below). I would like to trap the (frequently used) Ctrl-S combo for saving a file and assign it to my Save_Generated subroutine instead of the Shift-S combo I am using now. Any ideas ? Thank you for your help.
kyry
!****************
! the call to PASSDIRKEYSQQ
iret = PASSDIRKEYSQQ (PASS_DIR_CNTRLC)
! assign the keys
key = GETCHARQQ()
select case(ichar(key))
case(3) ! Ctrl-C
call Sensit_Check
case(13) ! Ctrl-M
call Layer_Info_Input
case(15) ! Ctrl-O
call Load_Parameters
case(83) ! Shift-S
call Save_Generated
case (24) ! Ctrl-X
call UserExit
end select
!******************
kyry
!****************
! the call to PASSDIRKEYSQQ
iret = PASSDIRKEYSQQ (PASS_DIR_CNTRLC)
! assign the keys
key = GETCHARQQ()
select case(ichar(key))
case(3) ! Ctrl-C
call Sensit_Check
case(13) ! Ctrl-M
call Layer_Info_Input
case(15) ! Ctrl-O
call Load_Parameters
case(83) ! Shift-S
call Save_Generated
case (24) ! Ctrl-X
call UserExit
end select
!******************
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you go to CVF help index and enter 'ASCII', under 'ASCII chart 1' you will find the code for CTRL+S = 19. This just reflects the position of 'S' in the alphabet. CTRL+A=1, CTRL+Z=26.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
oh, I know the ASCII code for Ctrl-S (I should have said that in my message). It's just that even if I implement it in the code u see, is not working ... pressing Ctrl-S does nothing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to add this code to the list of acceleration keys. Somewhere (don't exactly remember where) I guess there should be a list of key codes that are associated with the corresponding command IDs from the menu resource.
-+-Ben-+-
-+-Ben-+-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that solution works if I define my own menu ... I am using the Quickwin interface and I don't need the accelerator table to be loaded
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Catching the keyboard accelerator table would seem to be the answer. However, if you go to the Windows API, you might notice the keyboard accelerator example already has the handle to the existing accelerator table. I have searched through the Windows API for a call which might give me the handle, but no luck. I suppose the closest I came was FindResource, but without knowing the names or IDs, that would be shooting in the dark.
slippery

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page