forums

TNT Basic Forums > Feedback
Keyboard Input
< Last Thread     Next Thread >
Author
Thread        Post A Reply

03-07-2003 23:32

Posted by:
No Frills

Click Here to Email No Frills   Find more posts by No Frills

Any ideas how 'high' up on your 'todo' list Keyboard Input is?

Just bog standard old school

input "blah blah: ";string

or

user_input=get(num of chars to allow user to input)

type commands?

A cheeky question maybe, but is there a particular reason it wasn't implemented when TNT was born? It's been part of BASIC since year dot I think.

thanks in advance

03-09-2003 22:36

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Errr... no reason at all really. It wasn't immediately easy to add, and we had other stuff we'd have rather done. It's also been something we've been meaning to add for well over a year now, but it's not something our users have really needed as no games use it.

However, one which works on screen in graphics mode would benefit everyone, especially games with high score tables.

I'll try and get both implemented soon.

Mark

03-09-2003 23:01

Posted by:
CubeFusion

Location:
California, USA

Find more posts by CubeFusion

http://home.earthlink.net/~cubefusion/downloads/keyboard_input.hqx

This is the remains of a chat program I was making in TNT Basic (Cancelled because of bugs involving sending Strings over a network). Inside is a couple procedures that would be useful in extracting text into a string. If you have any questions about this file, then feel free to ask me. I tried to name the variables in a self-explanatory way, but I did neglect to comment my code very well. Good Luck.

03-09-2003 23:04

Posted by:
CubeFusion

Location:
California, USA

Find more posts by CubeFusion

Ooops, here is a clickable link.

Click here

03-09-2003 23:05

Posted by:
CubeFusion

Location:
California, USA

Find more posts by CubeFusion

One more try and then I give up.

http://home.earthlink.net/~cubefusion/downloads/keyboard_input.hqx

03-09-2003 23:57

Posted by:
eLL

Click Here to Email eLL   Find more posts by eLL

Third TIme's the Charm

I was on the verge of building a 255 integer array for holding keyboard input, this will definitely save me time ::casts aside his copy of METaL::

03-10-2003 01:39

Posted by:
Machi

Click Here to Email Machi   Find more posts by Machi

Thanks for posting that program, you did a couple of little things differently to the way that I have in my similar code, so it's been useful to look at.

The problem is though, that you have to explicitly declare the key mappings within the TNT program. Not a problem if everyone was using the same keyboard, but we're not. To be honest, this only occurred to me when Danlabs posted a similar little keyboard input routine - with the mappings for a French keyboard.

The reason that I haven't included these routines in a real program so far is that I haven't wanted to deal with multiple languages and key mappings. MacOS of course takes care of these things for you in the normal course of events.

I would be interested in feedback from people whose keyboards aren't US standard and in comment from Mark or John re TNT futures

03-10-2003 14:49

Posted by:
No Frills

Click Here to Email No Frills   Find more posts by No Frills

thanks for all the info

Cheers to everyone for source, and examples etc.

I had the TNTKeyboard demo, and liked the way input was handled (albeit with French keyboard mappings) - and another high score board example that lets you define how many CHARS of input, then wrps around between user definable input - very nice.

But still - just the good ol' input "some text";string

or

int len=6
get_char(len)

to only allow 'len' keys would indeed be handy.

No one used keyboard input in games - yeah.... no doubt, as there's no input command <G>

It's like giving everyone white paint, then saying - oh - we don't sell black paint because all of our customers have painted their rooms in white.

still - thanks for the heads up - I think including the commands would make a lot of peope very happy.

04-04-2003 22:35

Posted by:
Wil Hostman

Find more posts by Wil Hostman

Input Command?

What I'd like to see is kind of a

a$ = InputBox (x1, y1, width, border, optCase, optMaxChars)

using currently set font, color, and size.
if border then x pixel border with 1 pixel gutter between border and text area, else 1 pixel gutter only.

case should be bitwise...
eg:
bit - val - use
1 - 1 - block lower case
2 - 2 - block upper case
3 - 4 -block numeric
4 - 8 -block extended
5 - 16 -block punctuation
6 - 32 -enable special keys
7 - 64 -block numpad keys
8 - 128 -block alphakeys

and

a$ = lineInput (MaxChars, optAltEndKeyAscii, ...)

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.