Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,184 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Two questions about inkey() instruction #442530
06/24/14 18:49
06/24/14 18:49
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
I read about inkey() function in the manual and two questions came to my mind:

1) Does inkey() instruction "freezes" the function calling it till Enter or Esc ,for example, is pressed ,then scan code is returned? I am just curious about what happens to functions order and stuff ( I already know that game_save/load and on_ functions are not executed)

2) The manual says that Enter or Tab confirms string change while Esc, Up, Down, PageUp and PageDown abort it. What if I want Enter and Esc ONLY for confirmation/abort? How to do it?

Greets!


Nothing to say ....
Re: Two questions about inkey() instruction [Re: CyberGhost] #442531
06/24/14 19:18
06/24/14 19:18
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Code your own input function if you need more dynamic things.
I believe this function is just for helping starters getting in programming without the need of coding too much theirself.
Ah, it should freeze the function its called from, but Im not sure since I dont use it at all laugh

Re: Two questions about inkey() instruction [Re: Ch40zzC0d3r] #442533
06/24/14 19:32
06/24/14 19:32
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I think approaches like the following could work, too:

var inkey_result = -1;
while(inkey_result != esc code && inkey_result != enter code) inkey(my_str); // wait should not be necessary here


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Two questions about inkey() instruction [Re: Superku] #442534
06/24/14 20:01
06/24/14 20:01
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
@Ch40zzC0d3r I think it's a good idea but too difficult for me grin . The main issue would be testing all keys ,and I can't use str_for_key().

@Superku You mean if I put it in a while loop it won't respond to keys of confirmation/aborting?

Last edited by CyberGhost; 06/24/14 20:47.

Nothing to say ....
Re: Two questions about inkey() instruction [Re: CyberGhost] #442535
06/24/14 20:23
06/24/14 20:23
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Test it!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Two questions about inkey() instruction [Re: Superku] #442542
06/25/14 00:23
06/25/14 00:23
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
Sorry, I had to close my laptop and post by mobile grin ...


Nothing to say ....
Re: Two questions about inkey() instruction [Re: CyberGhost] #442581
06/25/14 21:00
06/25/14 21:00
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
Ok. Thread closed.


Nothing to say ....
Re: Two questions about inkey() instruction [Re: CyberGhost] #442593
06/26/14 06:33
06/26/14 06:33
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yet I'm still posting in this thread. (^.^)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Two questions about inkey() instruction [Re: Superku] #442600
06/26/14 10:48
06/26/14 10:48
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
It's closed for me :X ....


Nothing to say ....

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1