1. Keyboarding Assistance

I need to know how to do proper keyboarding in DOS Euphoria.

I want the keyboard to recognize a pressed key without a pause.  Normally,
it detects the key once, waits a short while, then continues to recognize the
key again.  I don't want that to happen.  I want it to constantly receive the
keypress at a smooth rate without a pause after the first time.  How do I do
it?

new topic     » topic index » view message » categorize

2. Re: Keyboarding Assistance

Funkbrat wrote:
> 
> I need to know how to do proper keyboarding in DOS Euphoria.
> 
> I want the keyboard to recognize a pressed key without a pause.  Normally,
> it detects the key once, waits a short while, then continues to recognize the
> key again.  I don't want that to happen.  I want it to constantly receive the
> keypress at a smooth rate without a pause after the first time.  How do I do
> it?

Could we see a sample of your code that pauses.

Don Cole
 A Bug is an un-documented feature.
A Feature is a documented Bug.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Keyboarding Assistance

don cole wrote:
> 
> Funkbrat wrote:
> > 
> > I need to know how to do proper keyboarding in DOS Euphoria.
> > 
> > I want the keyboard to recognize a pressed key without a pause.  Normally,
> > it detects the key once, waits a short while, then continues to recognize
> > the
> > key again.  I don't want that to happen.  I want it to constantly receive
> > the
> > keypress at a smooth rate without a pause after the first time.  How do I do
> > it?
> 
> Could we see a sample of your code that pauses.
> 
> Don Cole

I don't really have any code.  Those were the wait_key() and get_key()
commands I were talking about.  What I want is to program my own keyboarding
routines that repeatedly recognize a key from the keyboard without a pause,
like for moving a player in a game, like a side-scroller or something.  I
just don't know how to do it.  I'm not that good with Euphoria yet.  I'm
asking what I need to do to make this happen.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Keyboarding Assistance

http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard

Get Michael Bolin's "Keyboard Interrupt Handler."

-=ck
"Programming in a state of Euphoria."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

5. Re: Keyboarding Assistance

cklester wrote:
> 
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard</a>
> 
> Get Michael Bolin's "Keyboard Interrupt Handler."
> 
> -=ck
> "Programming in a state of Euphoria."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>

I already tried that, but I don't know how it works or how to use it.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Keyboarding Assistance

Funkbrat wrote:
> 
> cklester wrote:
> > 
> > <a
> > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&amp;keywords=keyboard">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard</a>
> > 
> > Get Michael Bolin's "Keyboard Interrupt Handler."
> > 
> > -=ck
> > "Programming in a state of Euphoria."
> > <a
> > href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 
> I already tried that, but I don't know how it works or how to use it.

Then go here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=paddle+ball

and get Ralf Nieuwenhuijsen's "Paddle & Ball Game." He uses Michael's code
and you should be able to learn about it from there.

-=ck
"Programming in a state of Euphoria."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

7. Re: Keyboarding Assistance

Funkbrat wrote:
> 
> cklester wrote:
> > 
> > <a
> > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&amp;keywords=keyboard">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard</a>
> > 
> > Get Michael Bolin's "Keyboard Interrupt Handler."
> > 
> > -=ck
> > "Programming in a state of Euphoria."
> > <a
> > href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 
> I already tried that, but I don't know how it works or how to use it.

Why don't you go to the archive and see how other user's are
scrolling, here's the location of some scrollers.

http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=scrolling

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.exw

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

8. Re: Keyboarding Assistance

Funkbrat wrote:
> 
> don cole wrote:
> > 
> > Funkbrat wrote:
> > > 
> > > I need to know how to do proper keyboarding in DOS Euphoria.
> > > 
> > > I want the keyboard to recognize a pressed key without a pause.  Normally,
> > > it detects the key once, waits a short while, then continues to recognize
> > > the
> > > key again.  I don't want that to happen.  I want it to constantly receive
> > > the
> > > keypress at a smooth rate without a pause after the first time.  How do I
> > > do
> > > it?
> > 
> > Could we see a sample of your code that pauses.
> > 
> > Don Cole
> 
> I don't really have any code.  Those were the wait_key() and get_key()
> commands I were talking about.  What I want is to program my own keyboarding
> routines that repeatedly recognize a key from the keyboard without a pause,
> like for moving a player in a game, like a side-scroller or something.  I
> just don't know how to do it.  I'm not that good with Euphoria yet.  I'm
> asking what I need to do to make this happen.


Hello Funkbrat,

  I might be missing something here, but I don't understand how you can 
determine that there is a pause after your keyboard recognizizes a key,
if you have no code to execute.

Again I would like to see the code that is causing this pause.

Don Cole
 A Bug is an un-documented feature.
A Feature is a documented Bug.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Keyboarding Assistance

Bernie Ryan wrote:
> 
> Funkbrat wrote:
> > 
> > cklester wrote:
> > > 
> > > <a
> > > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard</a>
> > > 
> > > Get Michael Bolin's "Keyboard Interrupt Handler."
> > > 
> > > -=ck
> > > "Programming in a state of Euphoria."
> > > <a
> > > href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> > 
> > I already tried that, but I don't know how it works or how to use it.
> 
> Why don't you go to the archive and see how other user's are
> scrolling, here's the location of some scrollers.
> 
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=scrolling">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=scrolling</a>
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.exw
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

I don't need help with scrolling, I need help with keyboarding.

As for you don cole, I told you I don't have code.  It's the wait_key() and
get_key() that give a pause before recognizing the key again.  I'm asking
how to make my own keyboarding routines, not for help on correcting code.

But just forget it you guys.  I'm going to try to figure out how to use
Michael Bolin's Keyboard Interrupt Handler.  Thanks for trying to help me
out, though.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Keyboarding Assistance

Funkbrat wrote:

> I don't need help with scrolling, I need help with keyboarding.
> 
> As for you don cole, I told you I don't have code.  It's the wait_key() and
> get_key() that give a pause before recognizing the key again.  I'm asking
> how to make my own keyboarding routines, not for help on correcting code.
> 
> But just forget it you guys.  I'm going to try to figure out how to use
> Michael Bolin's Keyboard Interrupt Handler.  Thanks for trying to help me
> out, though.

If you download this program like I explained to you
you will find a keyboard routine that is writen in Euphoria assembler
and would be the fastest.

http://www.rapideuphoria.com/contribz.zip

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.exw

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

11. Re: Keyboarding Assistance

Funkbrat wrote:
> 
> Bernie Ryan wrote:
> > 
> > Funkbrat wrote:
> > > 
> > > cklester wrote:
> > > > 
> > > > <a
> > > > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&keywords=keyboard</a>
> > > > 
> > > > Get Michael Bolin's "Keyboard Interrupt Handler."
> > > > 
> > > > -=ck
> > > > "Programming in a state of Euphoria."
> > > > <a
> > > > href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> > > 
> > > I already tried that, but I don't know how it works or how to use it.
> > 
> > Why don't you go to the archive and see how other user's are
> > scrolling, here's the location of some scrollers.
> > 
> > <a
> > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=scrolling">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=scrolling</a>
> > 
> > Bernie
> > 
> > My files in archive:
> > w32engin.ew mixedlib.e eu_engin.e win32eru.exw
> > 
> > Can be downloaded here:
> > <a
> > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>
> 
> I don't need help with scrolling, I need help with keyboarding.
> 
> As for you don cole, I told you I don't have code.  It's the wait_key() and
> get_key() that give a pause before recognizing the key again.  I'm asking
> how to make my own keyboarding routines, not for help on correcting code.
> 
> But just forget it you guys.  I'm going to try to figure out how to use
> Michael Bolin's Keyboard Interrupt Handler.  Thanks for trying to help me
> out, though.

I'm not sure exactly what you want, but in DOS there's a command:

   MODE CON[RATE=(number)][DELAY=(number)]

It lets you control the repeat rate on the keyboard,
and the initial delay before keys start repeating.
I don't know if it works on all versions of DOS.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

12. Re: Keyboarding Assistance

don cole wrote:
> 
> Funkbrat wrote:
> > 
> > don cole wrote:
> > > 
> > > Funkbrat wrote:
> > > > 
> > > > I need to know how to do proper keyboarding in DOS Euphoria.
> > > > 
> > > > I want the keyboard to recognize a pressed key without a pause. 
> > > > Normally,
> > > > it detects the key once, waits a short while, then continues to
> > > > recognize the
> > > > key again.  I don't want that to happen.  I want it to constantly
> > > > receive the
> > > > keypress at a smooth rate without a pause after the first time.  How do
> > > > I do
> > > > it?
> > > 
> > > Could we see a sample of your code that pauses.
> > > 
> > > Don Cole
> > 
> > I don't really have any code.  Those were the wait_key() and get_key()
> > commands I were talking about.  What I want is to program my own keyboarding
> > routines that repeatedly recognize a key from the keyboard without a pause,
> > like for moving a player in a game, like a side-scroller or something.  I
> > just don't know how to do it.  I'm not that good with Euphoria yet.  I'm
> > asking what I need to do to make this happen.
> 
> 
> Hello Funkbrat,
> 
>   I might be missing something here, but I don't understand how you can 
> determine that there is a pause after your keyboard recognizizes a key,
> if you have no code to execute.
> 
> Again I would like to see the code that is causing this pause.
> 
> Don Cole

Once I realized what he was talking about, I made a quick test. 
integer key
atom timer

timer = time()
key = get_key()
while key != 27 do -- esc
    key = get_key()
    if key != -1 then
        if key > 32 and key < 127 then
            ? {key, time() - timer}
        end if
        timer = time()
    end if
    
end while


It's probably related to how DOS/Windows handles key-repeat. After pressing a
key, I get about a .5s pause before the key starts repeating at about .03 seconds
between.

Otherwise I don't know how to help him.

Funkbrat: are you writing for DOS or Windows?


--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

13. Re: Keyboarding Assistance

Robert Craig wrote:
 
> I'm not sure exactly what you want ...

The documentation for get_key() says it doesn't wait for the user and returns -1
if there is no key in the buffer. However, this doesn't seem to be the case
(Windows XP SP2). It blocks, waiting for keyboard input. So the original poster
might wondering why there is a 'pause' instead of just returning -1?

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

14. Re: Keyboarding Assistance

Derek Parnell wrote:
> 
> Robert Craig wrote:
>  
> > I'm not sure exactly what you want ...
> 
> The documentation for get_key() says it doesn't wait for the user and returns
> -1 if there is no key in the buffer. However, this doesn't seem to be the case
> (Windows XP SP2). It blocks, waiting for keyboard input. So the original
> poster
> might wondering why there is a 'pause' instead of just returning -1?

That wasn't the case for my simple test programs. Except for a delay before the
key started repeating (which is what I think the original poster was talking
about) the routine returned immediately. (Windows XP Pro SP2, exwc.)


--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

15. Re: Keyboarding Assistance

Jason Gade wrote:

> That wasn't the case for my simple test programs. Except for a delay before
> the key started repeating (which is what I think the original poster was
> talking
> about) the routine returned immediately. (Windows XP Pro SP2, exwc.)

Okay. 

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

16. Re: Keyboarding Assistance

Derek Parnell wrote:
> 
> Jason Gade wrote:
> 
> > That wasn't the case for my simple test programs. Except for a delay before
> > the key started repeating (which is what I think the original poster was
> > talking
> > about) the routine returned immediately. (Windows XP Pro SP2, exwc.)
> 
> Okay. 
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> Skype name: derek.j.parnell

Sorry. Maybe I should repeat English. smile

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu