1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-03 12:21:20 +00:00

Simpler quick key visual cue, using the status area

This commit is contained in:
SteveMcNeill 2020-12-31 00:39:21 -05:00
parent db20865a1d
commit 2f133204a2

View file

@ -4884,44 +4884,27 @@ FUNCTION ide2 (ignore)
END IF END IF
IF menu$(m, s) = "Insert Quick Keycode... Ctrl+K" THEN IF menu$(m, s) = "Insert Quick Keycode... Ctrl+K" THEN
ideQuickKeycode: ideQuickKeycode:
PCOPY 2, 0 DO: tempk = _KEYHIT: _LIMIT 30: LOOP UNTIL tempk = 0 'wait for key release
DO 'get the next key hit
tempimage = _NEWIMAGE(240, 120, 32) PCOPY 3, 0
w = _WIDTH * _FONTWIDTH: h = _HEIGHT * _FONTHEIGHT LOCATE idewy - 3, 2
d = _DEST: s = _SOURCE PRINT "PRESS ANY KEY TO INSERT _KEYHIT/_KEYDOWN CODE"
_DEST tempimage tempk = _KEYHIT
DO IF tempk > 0 THEN tempk$ = STR$(tempk)
tempk = _KEYHIT _LIMIT 30
_LIMIT 30
LOOP UNTIL tempk = 0
DO
CLS , &HFF000077
tempk = _KEYHIT
IF tempk > 0 THEN tempk$ = STR$(tempk)
LINE (5, 5)-(115, 20), &HFF000000, BF
_PRINTSTRING (5, 5), "Keycode: " + k$
tempHWimage = _COPYIMAGE(tempimage, 33)
_PUTIMAGE (0, 0)-(w, h), tempHWimage
_DISPLAY
_LIMIT 30
LOOP UNTIL tempk$ <> "" LOOP UNTIL tempk$ <> ""
_AUTODISPLAY
tempk$ = tempk$ + " " tempk$ = tempk$ + " "
_DEST d: _SOURCE s a$ = idegetline(idecy)
_FREEIMAGE tempimage
l = idecy
a$ = idegetline(l)
l$ = LEFT$(a$, idecx - 1): r$ = RIGHT$(a$, LEN(a$) - idecx + 1) l$ = LEFT$(a$, idecx - 1): r$ = RIGHT$(a$, LEN(a$) - idecx + 1)
text$ = l$ + tempk$ + r$ text$ = l$ + tempk$ + r$
idesetline l, text$ idesetline idecy, text$
idecx = idecx + len(tempk$) idecx = idecx + len(tempk$)
idechangemade = 1 idechangemade = 1
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt
PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt retval = 1
retval = 1 GOSUB redrawItAll
GOSUB redrawItAll GOTO ideloop
GOTO ideloop
END IF END IF
IF LEFT$(menu$(m, s), 10) = "#Help On '" THEN 'Contextual menu Help IF LEFT$(menu$(m, s), 10) = "#Help On '" THEN 'Contextual menu Help