merthsoft wrote:
So next I need some GUI elements to pop up if a key is pressed during the mouse hook. This is what it looks like:
Code:
When I press Y=, my calc crashes. What am I missing?
Code:
MouseHook:
ld a,$fd ;group for ENTER
out (1), a
nop \ nop ;let the keyboard settle
in a,(1)
bit 0,a
jr z, ForceClick
ld a,KeyRow_Top ; group for the function row
out (1),a
nop \ nop
in a,(1)
cp dkY
jr z,OpenNamesWindow
ret
OpenNamesWindow:
PushGUIStack(GUIRSmallWin, NamesWindow, NamesWindowE-NamesWindow)
PushGUIStack(GUIRWinButtons, NamesWindowButtons, 7)
GUIMouse(0)
jp CloseNamesWindow
CloseNamesWindow
PopGUIStacks(2)
ret
You oh so very VERY VERY VERY VERY VERY much can't PushGUIStack and re-invoke the GUIMouse from inside the MouseHook, which itself is called from the GUIMouse.