Author Topic: Display the keycode of a keypress  (Read 3329 times)

0 Members and 1 Guest are viewing this topic.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3913
  • Rating: +184/-32
    • View Profile
    • wank.party
Display the keycode of a keypress
« on: March 23, 2011, 11:53:52 am »
Hi-

How can you display the key code of a keypress gotten from B_CALL _getKey on the screen?

thanks in advance!
I'm not a nerd but I pretend:

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4646
  • Rating: +717/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Display the keycode of a keypress
« Reply #1 on: March 23, 2011, 12:09:22 pm »
I would store it to HL and use _DispHL:
Code: [Select]
ld hl,0
 ld (CurRow),hl
 bcall(_getKey)
 ld l,a
 ld h,0
 bcall(_DispHL)
 ret

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3913
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Display the keycode of a keypress
« Reply #2 on: March 24, 2011, 03:55:09 am »
Thanks!
I'm not a nerd but I pretend:

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Display the keycode of a keypress
« Reply #3 on: March 24, 2011, 02:38:50 pm »
aeTIos, all of your questions are making me wanna relearn ASM so much =D

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3913
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Display the keycode of a keypress
« Reply #4 on: March 25, 2011, 09:12:06 am »
You can!
You should use Hot_Dogs asm tutorials then z80 in 28 days. (I finished that in like 5 days, gonna reread it a few times)
I'm not a nerd but I pretend:

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4646
  • Rating: +717/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Display the keycode of a keypress
« Reply #5 on: March 25, 2011, 08:23:38 pm »
That is probably the best method (reading it a few times). You won't absorb everything at first, but as you get practice and you learn something new, it will eventually all get absorbed :D

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8206
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Display the keycode of a keypress
« Reply #6 on: March 25, 2011, 08:24:37 pm »
You can!
You should use Hot_Dogs asm tutorials then z80 in 28 days. (I finished that in like 5 days, gonna reread it a few times)

You should. There were always things I missed each time I read it. It's actually interesting to read, too :D