Accepting Arrow-Key Input

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
thicks083
Posts: 5
Joined: 29 May 2014 08:35

Accepting Arrow-Key Input

#1 Post by thicks083 » 19 Aug 2014 08:05

Hello all. I am wondering if there is anyway to accept an arrow-key button press as input.
I am creating a text-based fantasy-adventure game and I would like to use this for movement.
For example:
I'd like to have the user be able to hit the arrows (on the lower right side of the keyboard) for their character to turn and face whatever direction their key corresponds too, and WASD for their character to move (forward, strafe left, backwards, strafe right) all while in that direction.
I would use the "choice" command, but I don't know I would take the arrow keys in.

Now, I can't tell if this might be cumbersome or not but my last method of movement had some very fuzzy logic so this seems like a better alternative.

Thanks!

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Accepting Arrow-Key Input

#2 Post by Squashman » 19 Aug 2014 08:11

I believe this topic has already be covered on the forums. Just need to dig up the thread. Pretty sure it is not possible if I recall correctly.
viewtopic.php?p=34426

thicks083
Posts: 5
Joined: 29 May 2014 08:35

Re: Accepting Arrow-Key Input

#3 Post by thicks083 » 19 Aug 2014 08:48

Squashman wrote:I believe this topic has already be covered on the forums. Just need to dig up the thread. Pretty sure it is not possible if I recall correctly.
viewtopic.php?p=34426


Ahh thank you so much! This seems pretty impractical, so I will try to figure something else out.

Aacini
Expert
Posts: 1932
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Accepting Arrow-Key Input

#4 Post by Aacini » 19 Aug 2014 08:56

There is no way to read extended keys using native Batch file commands. You may do that via an auxiliary third party .exe program, like my getkey.exe one. You may download it from this site; look for program #3.

Antonio

Post Reply