- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
!******************
コピーされたリンク
5 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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!
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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-+-
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
