English Amiga Board Amiga Lore


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 15 August 2011, 17:42   #1
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 32
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  
AdSense AdSense  
Old 16 August 2011, 09: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  
Old 16 August 2011, 15:39   #3
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 32
Thank you. It has good stuff in it. Also WB support and disabling requesters. Just what I needed. Case closed
Nut is offline  
Old 16 August 2011, 20:55   #4
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 32
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  
Old 08 May 2012, 16:28   #5
Nut
Registered User
 
Join Date: Feb 2010
Location: Helsinki, Finland
Posts: 32
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  
Old 08 May 2012, 16:53   #6
Ed Cruse
Registered User
 
Join Date: Sep 2007
Location: Las Cruces, USA
Age: 61
Posts: 350
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  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with my keyboard ! Mazout support.WinFellow 6 23 October 2014 12:15
Problem with ABNT-2 Keyboard. Leandro Jardim support.WinUAE 16 06 September 2012 06:34
Keyboard Key Problem.. A.I support.WinUAE 4 17 July 2007 11:41
Keyboard problem AndyDE support.WinUAE 9 25 June 2004 13:25
Keyboard problem nethermancer support.WinUAE 0 29 September 2002 21:11

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


All times are GMT +2. The time now is 04:32.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Page generated in 0.11728 seconds with 13 queries