Original date:2016-07-05 03:11:21 Edited by: petelomax Subject: Re: Allegro Wrapper Help

This quick hack worked for me, though I couldn't find any layout structures. I figured out the ev+20 from dumps, which is not exactly ideal.

atom display = 0  
atom event = 0  
atom key = 0  
display = al_create_display(800,600)  
event = al_create_event_queue()  
--key = al_install_keyboard()  
if not al_install_keyboard() then ?9/0 end if 
atom run = 1  
atom ev = allocate(512)     -- should be big enough... 
--program should end when ESC is pressed, but it does not happen  
while run = 1 do  
--      al_wait_for_event(event,0)  
        if peek4s(ev)=ALLEGRO_EVENT_KEY_DOWN then 
            key = peek4s(ev+20) 
            if key = ALLEGRO_KEY_ESCAPE then  
                run = 0  
            end if  
        end if 
end while  

Edit: I just found if key(KEY_ESC) then which may be what you are looking for?

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu