diff options
author | Sven Gothel <[email protected]> | 2013-02-19 08:00:38 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-19 08:00:38 +0100 |
commit | 85338858f5c58694fa88e77df1386d0556887944 (patch) | |
tree | 3fc6ff607520b6781c22fd50dd63aa62e79cfb10 /make | |
parent | a40ee817a3bd537b0de7018772b0835f995a1bed (diff) |
Bug 678 (fix), Bug 641 (API + Windows Impl.), Bug 688 (prep): Update NEWT's KeyEvent handling while distinguish keyCode (kbd layout independent) and keySym (kbd layout dependent)
API Changes:
- Virtual key codes and symbols are of type short.
- KeyEvent.keySymbol() shall return a layout dependent value (Bug 641)
- Method returns former keyCode() value, which was layout dependent.
- Returns 'short' value
- KeyEvent.keyCode() returns a short value, instead of int
- KeyEvent.keyCode() shall return a layout independent value (Bug 641)
- To ease implementation, we only 'require' the scan code to be mapped to a 'US Keyboard layout',
which allows reusing layout dependent code while preserving the goal to have a fixed physical key association
- Implementation status:
- Windows OK
- X11 TODO
- OSX: 50/50 TODO
- Using layout independent 'action keys'
- Using layout dependent 'printable keys'
- returning above semantics for both, keyCode and keySym
- Android 50/50 TODO
- Returning the layout independent keyCode
- Mapping probably incomplete
- KeyEvent.EVENT_KEY_TYPED and KeyListener.keyTyped(KeyEvent) (Bug 688)
- Marked DEPRECATED
- No more called for auto-repeat events
- Synthesized in WindowImpl.consumeKeyEvent(..): No more injection by native- or java driver code
- NEWTEvent.eventType: int -> short
- field, as well as all method involving eventType changed to short.
- NEWTEvent.isSystemEvent: REMOVED
- Never used as well as never being implemented properly
Internal Changes:
- Simplified keyEvent driver code
- Especially the Windows native driver's mapping code
could be simplified using scanCode and MapVirtualKeyEx
- NEWT Event Factories: hashMap -> switch/case
Unit Tests:
-
- Added NewtCanvasAWT Offscreen Layer Tests
important to test the AWT -> NEWT translation on OSX/CALayer:
- TestNewtKeyCodeModifiersAWT
- TestNewtKeyCodesAWT
- TestNewtKeyEventAutoRepeatAWT
- TestNewtKeyEventOrderAWT
- TestNewtKeyPressReleaseUnmaskRepeatAWT
Diffstat (limited to 'make')
-rw-r--r-- | make/build-test.xml | 38 | ||||
-rwxr-xr-x | make/scripts/java-win32-dbg.bat | 1 | ||||
-rwxr-xr-x | make/scripts/make.jogl.all.linux-x86_64.sh | 6 | ||||
-rwxr-xr-x | make/scripts/tests-x64.bat | 8 | ||||
-rwxr-xr-x | make/scripts/tests.sh | 7 |
5 files changed, 51 insertions, 9 deletions
diff --git a/make/build-test.xml b/make/build-test.xml index 4163e98bb..b3b121049 100644 --- a/make/build-test.xml +++ b/make/build-test.xml @@ -442,6 +442,44 @@ </junit> </target> + <target name="junit.run.newt.event" depends="test.compile"> + <!-- Test*AWT* --> + <junit jvm="${jvmJava.exe}" forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}"> + <env key="${system.env.library.path}" path="${obj.all.paths}"/> + <jvmarg value="${junit.run.arg0}"/> + <jvmarg value="${junit.run.arg1}"/> + <jvmarg value="${jvmDataModel.arg}"/> + <jvmarg value="-Djava.library.path=${obj.all.paths}"/> + + <!-- + <jvmarg value="-Dnewt.debug.EDT"/> + <jvmarg value="-Djogl.debug=all"/> + <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/> + <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/> + <jvmarg value="-Djogl.debug.GLSLState"/> + <jvmarg value="-Dnativewindow.debug=all"/> + <jvmarg value="-Dnewt.debug=all"/> + <jvmarg value="-verbose:jni"/> + <jvmarg value="-client"/> + <jvmarg value="-d32"/> + --> + + <formatter usefile="false" type="plain"/> + <formatter usefile="true" type="xml"/> + <!--classpath refid="junit_jogl_awt.run.classpath"/--> + <classpath refid="junit_jogl_swt.run.classpath"/> + + <batchtest todir="${results.test}"> + <fileset dir="${classes}"> + <include name="${java.dir.junit}/**/newt/event/Test**"/> + <exclude name="**/*$$*"/> + </fileset> + <formatter usefile="false" type="brief"/> + <formatter usefile="true" type="xml"/> + </batchtest> + </junit> + </target> + <target name="junit.run.awt.singletest" depends="test.compile"> <!-- Test*AWT* --> <junit jvm="${jvmJava.exe}" forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}"> diff --git a/make/scripts/java-win32-dbg.bat b/make/scripts/java-win32-dbg.bat index 1852d9b0c..cb2108b58 100755 --- a/make/scripts/java-win32-dbg.bat +++ b/make/scripts/java-win32-dbg.bat @@ -37,6 +37,7 @@ REM set D_ARGS="-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL" REM set D_ARGS="-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL" "-Djogl.debug=all"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display" "-Dnewt.test.Window.reparent.incompatible=true"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
+set D_ARGS="-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Xcheck:jni" "-Xint" "-verbose:jni"
set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
diff --git a/make/scripts/make.jogl.all.linux-x86_64.sh b/make/scripts/make.jogl.all.linux-x86_64.sh index 4642326d5..0bdde6831 100755 --- a/make/scripts/make.jogl.all.linux-x86_64.sh +++ b/make/scripts/make.jogl.all.linux-x86_64.sh @@ -28,6 +28,9 @@ fi # -Dtarget.sourcelevel=1.6 \ # -Dtarget.targetlevel=1.6 \ # -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \ +# +# -Dsetup.addNativeOpenMAX=true \ +# -Dsetup.addNativeKD=true \ #LD_LIBRARY_PATH=/opt-linux-x86_64/mesa-7.8.1/lib64 @@ -52,9 +55,6 @@ ant \ -Dtarget.sourcelevel=1.6 \ -Dtarget.targetlevel=1.6 \ -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \ - -Djavacdebuglevel="source,lines,vars" \ -Drootrel.build=build-x86_64 \ - -Dsetup.addNativeOpenMAX=true \ - -Dsetup.addNativeKD=true \ $* 2>&1 | tee -a $LOGF diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat index b4b05d58b..df855bf56 100755 --- a/make/scripts/tests-x64.bat +++ b/make/scripts/tests-x64.bat @@ -65,14 +65,16 @@ REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestParenting01 REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestListenerCom01AWT REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventOrderAWT %* +REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodeModifiersAWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventAutoRepeatAWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyPressReleaseUnmaskRepeatAWT %* -scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT %* -REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodeModifiersAWT %* +REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT %* + +REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT $* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersAWTCanvas %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasAWT %* -REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasSWT %* +scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasSWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting02NEWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01bAWT %* diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 5a7c0f0ec..7a65c736a 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -168,7 +168,7 @@ function jrun() { #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT -Djogl.debug.GLContext" #D_ARGS="-Dnewt.debug.Window -Djogl.debug.Animator -Dnewt.debug.Screen" #D_ARGS="-Dnewt.debug.Window" - #D_ARGS="-Dnewt.debug.Window.KeyEvent" + D_ARGS="-Dnewt.debug.Window.KeyEvent" #D_ARGS="-Dnewt.debug.Window.MouseEvent" #D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug=all" #D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug.JAWT -Djogl.debug.Animator" @@ -302,7 +302,7 @@ function testawtswt() { #testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer01GLCanvasAWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer02NewtCanvasAWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove01GLCanvasSwingAWT $* -testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove02GLWindowNewtCanvasAWT $* +#testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove02GLWindowNewtCanvasAWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove03GLWindowNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT $* @@ -417,8 +417,9 @@ testawt com.jogamp.opengl.test.junit.jogl.acore.TestAddRemove02GLWindowNewtCanva #testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventAutoRepeatAWT $* #testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyPressReleaseUnmaskRepeatAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* -#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT $* +testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT $* #testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodeModifiersAWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* #testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT $* #testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersAWTCanvas $* #testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasAWT $* |