EASy68K  
It is currently Sat Oct 21, 2017 3:05 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon May 11, 2009 2:26 am 
Offline

Joined: Wed Apr 01, 2009 5:09 pm
Posts: 18
Location: Calvary, Georgia
b]I need the function keys, the cursor keys along with
delete, insert, pgup, page down, and most of the control keys.
My 68000 machine can use a PC keyboard and all of he keys are
decoded, If you need he source code I can supply it. My word processing and business programs will not work without the special
keys for proper control.
Dan danfar@windstream.net
[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 24, 2009 11:12 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1048
Trap task 19 will read the key code.

Code:
*-----------------------------------------------------------
* Written by    : CK
* Description   : Display key code
* Note. Several function keys are predefined by the simulator
*-----------------------------------------------------------
START   ORG   $1000

loop
    move.b   #19,d0      ; read key code
    clr.l   d1
   trap   #15
   move.b   #15,d0      ; display d1 as number
   move.b   #16,d2      ; in base 16
   trap   #15
   lea       crlf,a1
   move.b   #14,d0
   trap   #15
       
   bra   loop            ; infinite loop

crlf   dc.b   $d,$a,0

   END   START

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Mon May 25, 2009 8:16 pm 
Offline

Joined: Wed Apr 01, 2009 5:09 pm
Posts: 18
Location: Calvary, Georgia
THAT WORKS, THANK YOU
However, how do I know if input is pending from the special keys? The #7 function does not respond from the special keys. I can compare if the key input is the same as the last input and ignore it until I get a new key input, but that does not work if I want to input 2 or more of the same key such as up arrow. Is there a way to reset the last keycode entered to zero?
Dan


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 26, 2009 12:50 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1048
Trap task #19 may also be used to test for 4 specific keys. Place the key codes for the corresponding keys in register D1.L
Pre: D1.L = four 1-byte key codes
Post: D1.L contains four 1-byte Booleans.
$FF = corresponding key is pressed, $00 = corresponding key not pressed.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Tue May 26, 2009 3:08 am 
Offline

Joined: Wed Apr 01, 2009 5:09 pm
Posts: 18
Location: Calvary, Georgia
OK, if I expect text and 12 different commands, I will have to load up D!and function 19 3 times and function 7 and go into a loop waiting for an input char from the keyboard. The televideo terminal and the smartee terminal I wrote for the VGA and IBM keyboard was a lot simpler. I think I could get by with only 20 different commands, That would require 5 function 19 and 1 function 7. If I put that into the BIOS my programs would never know the difference. I 'll let you know if it works
Dan


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 26, 2009 11:27 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1048
Several of the function keys are predefined in the simulator. I'll take a look at adding the ability to disable the simulator function keys for programs that want to use them.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Tue May 26, 2009 2:11 pm 
Offline

Joined: Wed Apr 01, 2009 5:09 pm
Posts: 18
Location: Calvary, Georgia
That would help.
The function #19 does not reset the last keypress. Nothing I do will work, as long as the key is depressed you get output, after that you can't get any response until an ascii key is depressed, then if 2 ascii keys are depressed you get two returns. Function 7 will dot reset or will function 5 reset.
The best solution is for the d1=0 function #19 to read the last keypress and reset. do not continue to read as long as the key is depressed and then be ready to get the next keypress even if it is the same key.
Your demo program run continuously and it should not. It should output one character and wait for the next keypress The same way function 5 will clear the input buffer.
Dan


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 27, 2009 1:17 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1048
I have expanded my above example. Trap task #19 may also be used to test the current state of a key. In this example the key scan code for a key is displayed only once. The program then waits for the key to be released.

Code:
*-----------------------------------------------------------
* Written by    : CK
* Description   : Display key code
* Note. Several function keys are predefined by the simulator
*-----------------------------------------------------------
START   ORG   $1000

loop
    move.b  #19,d0      ; read key code of last key press
    clr.l   d1
    trap    #15
    move.b  d1,d3       ; save key code
    trap    #15         ; check to see if it is currently pressed
    tst.b   d1          ; d1.b = 00 if key not pressed
    beq     loop        ; wait until key press
   
    move.b  d3,d1
    move.b  #15,d0      ; display key code
    move.b  #16,d2      ; in base 16
    trap    #15
   
    lea     crlf,a1
    move.b  #14,d0      ; display newline
    trap    #15
       
keydown
    move.b  #19,d0      ; wait for key up
    move.b  d3,d1       ; restore key code
    trap    #15
    tst.b   d1          ; d1.b = $FF if key pressed
    bne     keydown

    bra     loop        ; infinite loop

crlf   dc.b   $d,$a,0

   END   START

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Thu May 28, 2009 2:58 pm 
Offline

Joined: Wed Apr 01, 2009 5:09 pm
Posts: 18
Location: Calvary, Georgia
That works fine
Thank you
Dan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 02, 2009 7:17 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1048
V4.7.0 has a new trap task to disable simulator shortcuts so that all keys may be read with task 19.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group