Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
237 user(s) are online (99 user(s) are browsing Forums)

Members: 0
Guests: 237

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_data, uint32 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,
  
NULL, NULL,
  
"rjd324_W_A_S_D", 
  
NULL, NULL, 0, 0, 0, 0, WBENCHSCREEN
};
struct Window *window;

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

struct IntuiText w={1, NULL, JAM1, 0, 0, NULL, W, NULL};
struct IntuiText a={1, NULL, JAM1, 0, 0, NULL, A, NULL};
struct IntuiText s={1, NULL, JAM1, 0, 0, NULL, S, NULL};
struct IntuiText d={1, NULL, JAM1, 0, 0, NULL, D, NULL};

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

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

  {
    
SetAPen(window->RPort,0);
    while(
1) {
#if defined (QK)
      
QueryKeys(q, 4u);
      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 *msg= GetMsg(window->UserPort);
      if(
msg) {
            if( 
msg->Class==CLOSEWINDOW){ ReplyMsg(msg);
                break;
              }
        
ReplyMsg(msg);
      }
        }
 
ENDER:
  if(
window) CloseWindow(window);
  return 
0;
  }
}


Edited by rjd324 on 2022/1/10 21:45:08
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