Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
121 user(s) are online (113 user(s) are browsing Forums)

Members: 0
Guests: 121

more...

Support us!

Headlines

 
  Register To Post  

low level keyboard interrupt function not called
Just popping in
Just popping in


See User information
I look at the SDK AddKBInt in low level.

created a function:

uint32 KeyboardIntFunc(APTR is_datauint32 rawkeycode)
{
  
// code goes here
  
return 0;
}


added it using AddKBint(KeyboardIntFunc,NULL).

programs also opens a window and waits for signals.

when i press the keyboard my routine is not being run.

anyone know why?

Go to top
Re: low level keyboard interrupt function not called
Just popping in
Just popping in


See User information
https://www.amigans.net/modules/xforum/viewtopic.php?post_id=67208

this thread is interesting seems to be saying that the lowlevel routines are not doing what the autodocs say.

i wonder if lowlevel is kind of broken. i also see that getkey works, but querykeys does not.

Go to top
Re: low level keyboard interrupt function not called
Quite a regular
Quite a regular


See User information
Interestingly, I have an issue with QueryKeys as referenced in the other thread.

Here is a quick hacked-as-hell program where Querykeys works on the classic machine, but nothing on my X1000. In all cases, GetKey works.
/* GetKey:    gcc -D__USE_INLINE__ -DGK -o main main.c -lauto
   QueryKeys: gcc -D__USE_INLINE__ -DQK -o main main.c -lauto */

#if defined __amigaos4__
#define INTUITION_PRE_V36_NAMES
#include <intuition/iobsolete.h>
#endif

#include <proto/graphics.h>
#include <proto/lowlevel.h>
#include <proto/intuition.h>
#include <proto/exec.h>

struct NewWindow nw={
  
100,100,200,100,NULL,NULL,
  
CLOSEWINDOW,
  
ACTIVATE|WINDOWCLOSE|SIMPLE_REFRESH,
  
NULLNULL,
  
"rjd324_W_A_S_D"
  
NULLNULL0000WBENCHSCREEN
};
struct Window *window;

UBYTE W[2]={ 'W'};
UBYTE A[2]={ 'A'};
UBYTE S[2]={ 'S'};
UBYTE D[2]={ 'D'};

struct IntuiText w={1NULLJAM100NULLWNULL};
struct IntuiText a={1NULLJAM100NULLANULL};
struct IntuiText s={1NULLJAM100NULLSNULL};
struct IntuiText d={1NULLJAM100NULLDNULL};

struct KeyQuery q[4] = { { 0x0011}, { 0x0020}, { 0x0021}, { 0x0022} };

int main(void) {
  
window=(struct Window*)OpenWindow(&nw);
  if(!
window)
    {
      goto 
ENDER;
    }

  {
    
SetAPen(window->RPort,0);
    while(
1) {
#if defined (QK)
      
QueryKeys(q4u);
      if(
q[0].kq_Pressed){
        
PrintIText(window->RPort,&w,100,40);
      } else {
        
RectFill(window->RPort,95,35,115,55);
      }
      if(
q[1].kq_Pressed){
        
PrintIText(window->RPort,&a,25,80);
      } else {
        
RectFill(window->RPort,20,75,40,95);
      }
      if(
q[2].kq_Pressed){
        
PrintIText(window->RPort,&s,100,80);
      } else {
        
RectFill(window->RPort,95,75,115,95);
      }
      if(
q[3].kq_Pressed){
        
PrintIText(window->RPort,&d,175,80);
      } else {
        
RectFill(window->RPort,170,75,190,95);
      }
#elif defined (GK)
          
ULONG k GetKey();
      if(
k==0x0011){
        
PrintIText(window->RPort,&w,100,40);
      } else {
        
RectFill(window->RPort,95,35,115,55);
      }
      if(
k==0x0020){
        
PrintIText(window->RPort,&a,25,80);
      } else {
        
RectFill(window->RPort,20,75,40,95);
      }
      if(
k==0x0021){
        
PrintIText(window->RPort,&s,100,80);
      } else {
        
RectFill(window->RPort,95,75,115,95);
      }
      if(
k==0x0022){
        
PrintIText(window->RPort,&d,175,80);
      } else {
        
RectFill(window->RPort,170,75,190,95);
      }

#else
#error "Please define QK or GW"
#endif
      
struct IntuiMessage *msgGetMsg(window->UserPort);
      if(
msg) {
            if( 
msg->Class==CLOSEWINDOW){ ReplyMsg(msg);
                break;
              }
        
ReplyMsg(msg);
      }
        }
 
ENDER:
  if(
windowCloseWindow(window);
  return 
0;
  }
}


Edited by rjd324 on 2022/1/10 21:45:08
If liberty means anything at all, it means the right to tell people what they do not want to hear.
George Orwell.
Go to top

  Register To Post

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project