Jeff here follows the code for the getch tests:
!Test input of keystroke using SF2/AppGraphics
use AppGraphics
integer exchar, exchar1,win_unit
character*1 ch
win_unit = initwindow (1200, 800, 'test keystroke using AppGraphics', 1000,100)
call outtext("Type <CTRL> and X to exit, S to scroll, D to pass Direction keys")
! Add mouse_______________________________________________________________________________
! Register mouse handler much more easy than CVF!!!!
call registermousehandler(MOUSE_LB_DOWN , handle_click)
call registermousehandler(MOUSE_RB_DOWN , handle_click)
! For the full available set of command key strokes use AppGraphic constants
Do while (exchar.ne.24) ! ASCII 24 = CAN (cancel) = <CTR>x or X
exchar = getch() ; If(exchar == 0) exchar1 = getch()
IF(exchar == 0)then
If(exchar1==KEY_UP )print *,"AppGraphics key UP = ",exchar, exchar1
If(exchar1==KEY_RIGHT)print *,"AppGraphics key Right= ",exchar, exchar1
If(exchar1==KEY_LEFT )print *,"AppGraphics key Left = ",exchar, exchar1
If(exchar1==KEY_DOWN )print *,"AppGraphics key Down = ",exchar, exchar1
!The next characters are only working with additional key>0 like ENTER
If(exchar1==KEY_DELETE)print *,"DELETE = ",exchar, exchar1
If(exchar1==KEY_HOME )print *,"Home = ",exchar, exchar1
If(exchar1==KEY_INSERT)print *,"INSERT = ",exchar, exchar1
If(exchar1==KEY_PGUP )print *,"AppGraphics key PGUP= ",exchar, exchar1
If(exchar1==KEY_PGDN )print *,"AppGraphics key PGDN= ",exchar, exchar1
If(exchar1==KEY_F9 )print *,"AppGraphics key F9 = ",exchar, exchar1
If(exchar1==KEY_END )print *,"AppGraphics key END = ",exchar, exchar1
! how to simulater "Enter" [-> char(Key_Enter) ] after prev key's
else If(exchar < 32)then
IF(exchar == 8)print *,"backspace = ",exchar,'<32'
IF(exchar == 9)print *,"<TAB> = ",exchar,'<32'
IF(exchar ==13)print *,"ENTER = ",exchar,'<32'
IF(exchar ==27)print *,"<ESC> = ",exchar,'<32'
else
ch = char(exchar) ; print *,"printable key = ",ch
call outtext( ch)
endif
!Print*,char(7), 'BEL' ! no audit bell
!if(ch1 .eq. 'S') then
! print *, "Entering Scroll mode - in this test swiched off"
!endif
End do
print*,'finished'
Contains
subroutine handle_click(x, y)
implicit none
integer::x, y
print *, "Mouse position: ", x, y
Call Settextxy(x,y)
end subroutine handle_click
End
!Key Constants exchar exchar1 (not complete)
!KEY_HOME 0 71 3rd hit missing or enter simulation needed
!KEY_UP 0 72 OK
!KEY_PGUP 0 73 3rd hit missing or enter simulation needed
!KEY_LEFT 0 75 OK
.......
By the way: thanks for the new debugger in version 2.25 witch is working so far I see perfect also for AppGraphics!
Regards, Klaus