Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lock CAPS poking memory
#3
I'm reading LastK, and it's for the "redefine keyboard" feature. Here is the code:
Code:
REM subrutina para definir las teclas del juego
sub redefinir()

    print at 16,11; flash 1; "\::"; : pause 0 : pause 0 :    arriba = PEEK 23560
    print at 16,6; "UP _ "; INK 3; chr$(arriba);
    print at 16,25; flash 1; "\::"; : pause 0 : abajo = PEEK 23560
    print at 16,18; "DOWN _ "; INK 3; chr$(abajo);
    print at 17,13; flash 1; "\::"; : pause 0 : izqui = PEEK 23560
    print at 17,6; "LEFT _ "; INK 3; chr$(izqui);
    print at 17,25; flash 1; "\::"; : pause 0 : dere = PEEK 23560
    print at 17,17; "RIGHT _ "; INK 3; chr$(dere);
    
    PRINT AT 18,13; "   ";
    print at 18,13; flash 1; "\::"; : pause 0 : cambio = PEEK 23560
    if cambio = 32 then
        PRINT AT 18,6; "SWAP _ "; INK 3; "SPC";
    else if cambio = 13 then
        PRINT AT 18,6; "SWAP _ "; INK 3; "ENT";
    else
        PRINT AT 18,6; "SWAP _ "; INK 3; chr$(cambio);
    end if
    
    PRINT AT 18,25; "   ";
    print at 18,25; flash 1; "\::"; : pause 0 : subir = PEEK 23560
    if subir = 32 then
        PRINT AT 18,17; "RAISE _ "; INK 3; "SPC";
    else if subir = 13 then
        PRINT AT 18,17; "RAISE _ "; INK 3; "ENT";
    else
        PRINT AT 18,17; "RAISE _ "; INK 3; chr$(subir);
    end if

end sub

I evaluated the 32 substracts option, but it only counts for letter (obviously) so I have to control if the pressed key is a letter or not and right now I'm in the last stage of the game development and... truth is I feel lazy, so I was looking for the shortcut -get CAPS always on :roll:

Cheers


EDIT: tried the values your link says and you were right on BASIC, but it didn't work on ZX Basic. Anyway, there's a thing I don't get. This is what Your Spectrum says:
Quote:Specifies cursor. Values zero, one, two or four specify the L/C mode, E mode, G mode or K mode respectively.

How can value 0 be L and C at the same time? Is not any other value/variable in the ZX Spectrum to check that CAPS is ON? And thanks again, 2018 and still learning things about this computer Big Grin
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)