aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sys
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-06-28 19:06:14 +0200
committerSven Gothel <[email protected]>2013-06-28 19:06:14 +0200
commit54bbd1a726e73841f0bd4cc79e5b12e83a88ba18 (patch)
tree6e71430ad8217e1fce810b5310ec0b5b2766340c /src/jake2/sys
parent28ed823b1a804145b4dd741807a83570abc139e1 (diff)
Add Applet Feature incl. required fixes.
- Jake2Applet - Reenable JavaScript Bridge to resize Applet - Pass through 4:3 aspect custom video mode (Jake2 args) - Pass through applet parameter 'jake_args' (Jake2 args) - OSX Hack: Re-create Game at init, otherwise flickering appears (??) - Fix VID.init: Set vid_ref.modifier = true, otherwise not guaranteed VID creation - BeginFrame, R_BeginFrame, beginFrame, activateGLContext: Return 'true', if ctx is available, otherwise false to skip frame. - NEWTWin: - Applet mode (in Applet container): Always release GL ctx - Use GLAnimatorControl impl, to state whether we are animating or not and to tell us, whether we have to release the GL ctx. - Add HOME -> Reparent feature for Applets - Workaround for NEWT/Windows Bug 798 - NEWT Key Handling: - Ignore auto-repeat - Workaround for NEWT/Windows Bug 798 - Add HTML page - normal - debug mode
Diffstat (limited to 'src/jake2/sys')
-rw-r--r--src/jake2/sys/InputListener.java18
-rw-r--r--src/jake2/sys/NEWTKBD.java4
-rw-r--r--src/jake2/sys/Sys.java2
3 files changed, 16 insertions, 8 deletions
diff --git a/src/jake2/sys/InputListener.java b/src/jake2/sys/InputListener.java
index bff13d5..0b55f52 100644
--- a/src/jake2/sys/InputListener.java
+++ b/src/jake2/sys/InputListener.java
@@ -44,21 +44,25 @@ public final class InputListener implements KeyListener, MouseListener, WindowLi
}
static Jake2InputEvent nextEvent() {
- Jake2InputEvent ev;
- synchronized (eventQueue) {
- ev = (!eventQueue.isEmpty())?(Jake2InputEvent)eventQueue.removeFirst():null;
- }
- return ev;
+ Jake2InputEvent ev;
+ synchronized (eventQueue) {
+ ev = (!eventQueue.isEmpty())?(Jake2InputEvent)eventQueue.removeFirst():null;
+ }
+ return ev;
}
@Override
public void keyPressed(KeyEvent e) {
- addEvent(new Jake2InputEvent(Jake2InputEvent.KeyPress, e));
+ if( !e.isAutoRepeat() ) {
+ addEvent(new Jake2InputEvent(Jake2InputEvent.KeyPress, e));
+ }
}
@Override
public void keyReleased(KeyEvent e) {
- addEvent(new Jake2InputEvent(Jake2InputEvent.KeyRelease, e));
+ if( !e.isAutoRepeat() ) {
+ addEvent(new Jake2InputEvent(Jake2InputEvent.KeyRelease, e));
+ }
}
@Override
diff --git a/src/jake2/sys/NEWTKBD.java b/src/jake2/sys/NEWTKBD.java
index 4a0ba76..af54a36 100644
--- a/src/jake2/sys/NEWTKBD.java
+++ b/src/jake2/sys/NEWTKBD.java
@@ -119,6 +119,10 @@ final public class NEWTKBD extends KBD
private static int XLateKeyCode(KeyEvent ev) {
int code = ev.getKeyCode();
+ // FIXME: Workaround JOGL/NEWT Bug 798
+ if( 0 == code ) {
+ code = ev.getKeySymbol();
+ }
int key = 0;
switch(code) {
// 00626 case XK_KP_Page_Up: key = K_KP_PGUP; break;
diff --git a/src/jake2/sys/Sys.java b/src/jake2/sys/Sys.java
index 8ac8fb1..cefb303 100644
--- a/src/jake2/sys/Sys.java
+++ b/src/jake2/sys/Sys.java
@@ -226,7 +226,7 @@ public final class Sys extends Defines {
}
public static void SendKeyEvents() {
- Globals.re.getKeyboardHandler().Update();
+ Globals.re.getKeyboardHandler().Update();
// grab frame time
Globals.sys_frame_time = Timer.Milliseconds();