Ralf R. wrote:Really nice. Would be interesting to see, how you manage a PE compatible mouse driver. I think, it is worth a try to look at Urs' QTOP sources, as he (as far as I remenber) does not use any QPTR extensions (or any other) for his mouse driver.
QTop uses PTR_gen (for the mouse pointer) but not WMAN as QTop has ist own menu system.
Extract from TDESK_123_bas_cln:
Code: Select all
11310 DEFine PROCedure Selection(check%,check1%,check2%,check$)
11311 REMark V123 Use new LOCal check3% instead of GLOBal u
11312 LOCal check3%
11313 REMark KnowHow: check$<>con$ indicates single select menu, check$=con$ indicates multiple select menu
11315 fkey%=0
11320 IF check%=2 : a%=120 : menu_x1%=3 : menu_x2%=123 : menu_y1%=31+check1% : REMark KnowHow: Menu window
11325 IF check%=6 : a%=308 : menu_x1%=130 : menu_x2%=440 : menu_y1%=58+check1% : REMark KnowHow: Action window
11330 menu_y2%=10+menu_y1%+check2%*10
11335 REPeat key_loop%
11340 IF INKEY$(#cCh_UI_window_part1%)="" : EXIT key_loop%
11345 END REPeat key_loop%
11350 REPeat option_loop%
11355 OVER#check%,-1 : BLOCK#check%,a%,10,0,check1%+10*option,prg_cfg$(cCfg22_hrd5_menu_action_selection_bar_colour%) : REMark V123 Use prg_cfg$ was 7
11360 REPeat key_loop%
11365 IF timesaved<>DATE : StatusClock : REMark KnowHow: Do not update StatusBar more than once in a second
11370 IF qptr%=2 THEN
11375 IOP_RPTR : REMark KnowHow: See QPTR manual pages 58 and 59
11380 key=PEEK(pointerrecord+10) : REMark KnowHow: 0a byte 0=no keystroke <>0 key or button code
11385 REMark V122 Next Line added at around tdesk122x 04.10.1994, KnowHow: Most likely to support multiple select with mousedown
11390 IF ptri% AND key=0 AND check$=con$ : key=PEEK(pointerrecord+11) : REMark KnowHow: 0b byte 0=no key down <>0 space or button depressed, only read this if on another menu item and in multiple select mode
11395 SELect ON key
11400 =keyMouseLeftHit% : key=keySPACE%
11405 =keyMouseRightDo% : key=keyENTER%
11410 REMark =keyCURL%,keyALT_CURL%,keyCURR%,keyALT_CURR%,keyCURU%,keyALT_CURU%,keySHIFT_CURU%,keyCURD%,keyALT_CURD%,keySHIFT_CURD% : key=0
11411 =keyCURL%,keyALT_CURL%,keyCURR%,keyALT_CURR%,keyCURU%,keyALT_CURU%,keyCURD%,keyALT_CURD% : key=0 : REMark V123 Only suppress those keys, not keySHIFT_CURU% (PgUp) and keySHIFT_CURD% (PgDn)
11415 END SELect
11420 key$=CHR$(key)
11425 ELSE
11430 key$=INKEY$(#cCh_UI_window_part1%,50) : REMark wait up to 1 second for a keypress
11435 IF key$<>"" AND CODE(key$)=0 : key=keySPACE% : EXIT key_loop% : REMark V123 Changed was key$=" " KnowHow: key5onKeyPad% $00
11440 key=CODE(key$)
11445 END IF
11450 IF key$<>"" THEN
11451 REMark V123 Transition LT to PH AI4V124 rework related code see 14755 15095 16195
11452 IF check%=6 THEN
11453 IF key$="<" : key$="L" : REMark V123 Added to allow going back in the directory tree using the key "<" ("L"AST becomes "<")
11454 IF key$=="P" : key$="L" : REMark V123 Added to allow going back in the directory tree using the key "P" ("L"AST becomes "P"revious)
11455 IF key$=="H" : key$="T" : REMark V123 Added to allow choosing this directory using the key "H" ("T"HIS becomes "H"ere)
11456 IF key$=">" : key=keyENTER% : REMark V123 Added to allow a DO using the key ">"
11457 END IF
11459 check3%=key$ INSTR(check$) : REMark Use new LOCal check3% instead of GLOBal u
11460 IF check3% : key=11 : EXIT key_loop% : REMark Use new LOCal check3% instead of GLOBal u
11465 END IF
11470 SELect ON key
11472 =43 : WriteCurrentNew "Hardcoded configuration",1,"string",prg_cfg$ : IF fInput%(1,16,16,4)=0 : prg_cfg$=a$ : key=key/0 : REMark KnowHow: key + to change the hardcoded configuration string then enter the Error Handler
11475 =keyCURU%,keyCURD%,keyENTER%,keyESC%,keySPACE%,key5%,keyCTRL_ALT_CURU% : EXIT key_loop% : REMark V123 Added key5%
11480 =keyF1%,keyCTRL_F1%,keyF2%,keyF3%,keyF8%,keyF4%,keyCTRL_F4%,keyF9%,keyF5%,keyF10% : fkey%=1 : EXIT key_loop% : REMark V123 Added F10
11485 =keyF6% : IF thor_argosv_major%=6 : fkey%=1 : EXIT key_loop% : REMark V123 Changed, now just check if a Thor XVI
11490 =keyALT_CURU%,keySHIFT_CURU%,keyALT_CURD%,keySHIFT_CURD% : IF check$=con$ : EXIT key_loop% : REMark KnowHow: PgUp and PgDn
11495 =keyCURL%,keyCURR% : NEXT key_loop% : REMark KnowHow: No action but do not BEEP
11500 =0 : IF NOT qptr%=2 : NEXT key_loop%
11505 =REMAINDER : BEEP 1000,70
11510 END SELect
11515 IF qptr%=2 : IF fPtrInMenu% : EXIT key_loop%
11520 END REPeat key_loop%
11525 BLOCK#check%,a%,10,0,check1%+10*option,prg_cfg$(cCfg22_hrd5_menu_action_selection_bar_colour%) : OVER#check%,0 : REMark V123 Use prg_cfg$ was 7
11530 IF fkey% : RETurn
11535 SELect ON key
11540 =keyCURU% : option=option-1
11545 IF option<0 : option=check2%
11550 =keyCURD% : option=option+1
11555 IF option>check2% : option=0
11560 =keyENTER%,keySPACE%,key5% : RETurn : REMark V123 Added key5%
11565 =11 : IF check$<>con$ : option=check3%-1 : REMark V123 Use new LOCal check3% instead of GLOBal u KnowHow: If Menu then set option
11570 RETurn : REMark Was wrongly added to previous line on some V123 betas
11575 =0 : IF NOT qptr%=2 : EXIT option_loop%
11580 =REMAINDER : EXIT option_loop%
11585 END SELect
11590 IF qptr%=2 : IF ptri% : option=option1
11595 END REPeat option_loop%
11600 SELect ON key
11605 =keyESC%,keyCTRL_ALT_CURU%,keyALT_CURD%,keySHIFT_CURD% : option=check2% : IF key=keyCTRL_ALT_CURU% : key=keyESC% : REMark KnowHow: PgDn
11610 =keyALT_CURU%,keySHIFT_CURU% : option=0 : REMark KnowHow: PgUp
11615 END SELect
11620 END DEFine
11625 :
11630 DEFine FuNction fPtrInMenu%
11635 IF D1=ptrpos : RETurn 0 : REMark V123 revert check for better understanding IF new xycoord=prv xycoord
11636 ptrpos=D1 : REMark V123 Added to store xycoord for next call, this makes sure CPU load (on emulators) is low
11645 IF ptr_x%>menu_x1% THEN
11650 IF ptr_x%<menu_x2% THEN
11655 IF ptr_y%>menu_y1% THEN
11660 IF ptr_y%<menu_y2% THEN
11665 option1=INT((ptr_y%-menu_y1%)/10)
11670 IF option1<>option : ptri%=-1 : RETurn -1 : REMark pointer on menu and on another menu item
11675 END IF
11680 END IF
11685 END IF
11690 END IF
11695 ptri%=0 : RETurn 0 : REMark pointer not on menu or still on same menu item
11700 END DEFine
QTop is on
“QL IS 30 2014 - THE DISTRIBUTION” http://sinclairql.net/repository.html#TheDistribution. In addition to the full installation package, the documentation and the sources there’s a preconfigured *.win for use with QPC2 and SMSQmulator. Download, try out and enjoy! QL forever, Urs