English Amiga Board    


Go Back   English Amiga Board > » Coders > Coders. General

Reply
 
Thread Tools
Old 15 August 2011, 16:42   #1
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 31
Keyboard buffer problem

I've done a program in ASM and it works fine. I can detect keys and qualifier keys by using a routine in lowlevel.library (so the background I/O system interrupt is running). BUT when I exit my program back to DOS some of the keys I had pressed get written to the DOS window. I suppose they come out of the keyboard buffer or maybe some system structure in memory that holds this stuff. I don't want this to happen. It looks like this in DOS...

1> myprogram
asdqwreytqrwyratsrdtrastrdtsrtrqywetrwterwtetwettqerwetqrwe
1>

I've tried to communicate with the keyboard.device and send a CMD_CLEAR for it and judging from the error codes this succeeded BUT it didn't fix the problem.

I haven't much played with devices (or libraries) before so what should I do???

There's probably something very basic that I have missed.
Nut is offline   Reply With Quote
Old 16 August 2011, 08:46   #2
Siggy999
Registered User
 
Siggy999's Avatar
 
Join Date: Mar 2008
Location: Las Vegas/Nevada
Posts: 104
I know Piru's startup.asm creates an input handler to swallow input so it doesn't drop through to the cli.

A link to it here:

http://www.sintonen.fi/src/hwstartup/hwstartup.asm

I picked up a lot going over that and trying to work out exactly what it does and how it goes about it.
Siggy999 is offline   Reply With Quote
Old 16 August 2011, 14:39   #3
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 31
Thank you. It has good stuff in it. Also WB support and disabling requesters. Just what I needed. Case closed
Nut is offline   Reply With Quote
Old 16 August 2011, 19:55   #4
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 31
Got it done. Solution was - add an input handler for the input device that tags events as NULL. The details I don't understand much but it works.
Nut is offline   Reply With Quote
Old 08 May 2012, 15:28   #5
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 31
Piru's solution has the disadvantage that it eats all the keys, so you can't close requesters for example. I kind of want it to prevent the echoing of characters on CLI only and not to prevent keystokes.

I found a new very simple solution. I open a small RAW window as first thing in my code. Then close it as last thing in my code. This window will eat all the keys but I will still be able to close requesters in error situations. It was super simple just call Open in exec library and have the filename as 'RAW:50/25/200/50/My Program',0.
Nut is offline   Reply With Quote
Old 08 May 2012, 15:53   #6
Ed Cruse
Registered User
 
Join Date: Sep 2007
Location: Las Cruces, USA
Age: 60
Posts: 335
Quote:
Originally Posted by Nut View Post
I've done a program in ASM and it works fine. I can detect keys and qualifier keys by using a routine in lowlevel.library (so the background I/O system interrupt is running). BUT when I exit my program back to DOS some of the keys I had pressed get written to the DOS window. I suppose they come out of the keyboard buffer or maybe some system structure in memory that holds this stuff. I don't want this to happen. It looks like this in DOS...

1> myprogram
asdqwreytqrwyratsrdtrastrdtsrtrqywetrwterwtetwettqerwetqrwe
1>

I've tried to communicate with the keyboard.device and send a CMD_CLEAR for it and judging from the error codes this succeeded BUT it didn't fix the problem.

I haven't much played with devices (or libraries) before so what should I do???

There's probably something very basic that I have missed.
Could you have a bug in your program that is causing it to output to the Standard FileHandle (print to dos) during the program clean up before it exits? I've seen this before but the program was actually doing the printing. The keyboard buffer should be empty as long as the Input Handler Chain is working properly.
Ed Cruse is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having problem with keyboard and winUAE Dakumaru support.WinUAE 2 19 November 2007 18:58
Problem with my keyboard ! Mazout support.WinFellow 5 20 August 2004 05:49
Keyboard problem AndyDE support.WinUAE 9 25 June 2004 12:25
A1200 Keyboard problem Peanutuk support.Hardware 8 26 January 2004 09:46
Keyboard problem nethermancer support.WinUAE 0 29 September 2002 20:11


All times are GMT +2. The time now is 15:29.

-->

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Page generated in 0.14865 seconds with 11 queries