If no key is pressed with getk()

Other misc things
Post Reply
balloon
New member
Posts: 4
Joined: Wed Jul 03, 2019 2:07 am

If no key is pressed with getk()

Post by balloon »

Hello. I recently started using z88dk.
As I am from Japan, I am mainly familiar with the MSX and PC-E200/G800-G850 series.
I am active on GitHub and have submitted issues a few days ago.

Well, I want to check about getk(). I created a simple code:

Code: Select all

#include <stdio.h>

main(){
  while(1){
    printf("%d ",getk());
  }
}
If I run this on PC-G850 and have not typed in anything, the value gets 0.
but when run on MSX as well, the value was -24372.
Is this value different depending on the platform (not fixed value)?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

It is probably a bug. getk() is expected to give 0 when no key is pressed.
I will try you test program.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

The problem on the library source was quite evident, I think I fixed it already.. would you kindly test it again after the tomorrow's build?
balloon
New member
Posts: 4
Joined: Wed Jul 03, 2019 2:07 am

Post by balloon »

I understood. I think that will be reflected in today's Nightly, so I will test.
balloon
New member
Posts: 4
Joined: Wed Jul 03, 2019 2:07 am

Post by balloon »

I updated to the latest Nightly Build and built for MSX. It is getting 0. Thank you!
Post Reply