{"id":365,"date":"2011-10-13T17:20:48","date_gmt":"2011-10-13T21:20:48","guid":{"rendered":"http:\/\/jausoft.com\/blog\/?p=365"},"modified":"2019-05-14T04:47:28","modified_gmt":"2019-05-14T08:47:28","slug":"new-newt-mouse-features","status":"publish","type":"post","link":"https:\/\/jausoft.com\/blog\/2011\/10\/13\/new-newt-mouse-features\/","title":{"rendered":"New NEWT Mouse Features"},"content":{"rendered":"<p>After doing all the Android work, I thought I need a break and finally<br \/>\nadded the NEWT mouse features some are desiring:<\/p>\n<ul>\n<li>Visibility<br \/>\nset pointer visible or invisible\n<\/li>\n<li>Confined<br \/>\nconfine pointer to window, or not\n<\/li>\n<li>Warp<br \/>\nset mouse position within the window\n<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>This is <a href=\"http:\/\/jogamp.org\/git\/?p=jogl.git;a=blobdiff;f=src\/newt\/classes\/com\/jogamp\/newt\/Window.java;h=a69b8dbb390f77fc6753ce3d5e58246367599659;hp=24555bf395ee608a9e6f0c69f21700e8c069a5d9;hb=24e0591b6be036d5389cc1eb986ed5e86043ba65;hpb=51a9f23d629cd4e6b22d7afaf009bb96b2ed270f\">NEWT&#8217;s minimal API<\/a> addition in this regard.<\/p>\n<p>The InputEvent&#8217;s modifiers expose the above states <i>confined<\/i> and <i>invisible<\/i><br \/>\nwhich can be easily queried and reacted upon in the event listener, as shown in <a href=\"http:\/\/jogamp.org\/git\/?p=jogl.git;a=blob;f=src\/test\/com\/jogamp\/opengl\/test\/junit\/jogl\/demos\/es2\/GearsES2.java;hb=HEAD#l297\">GearsES2<\/a>.<\/p>\n<p>This allows you to have a game-like mouse navigation, where you control the direction w\/o pressing the mouse button (which you may need for something else), not seeing the mouse pointer and last but not least,<br \/>\nnot leaving the game window.<\/p>\n<p>Tested w\/ <a href=\"http:\/\/jogamp.org\/git\/?p=jogl.git;a=blob;f=src\/test\/com\/jogamp\/opengl\/test\/junit\/jogl\/demos\/es2\/newt\/TestGearsES2NEWT.java;hb=HEAD\">TestGearsES2NEWT<\/a>, using<br \/>\n<a href=\"http:\/\/jogamp.org\/git\/?p=jogl.git;a=blob;f=src\/test\/com\/jogamp\/opengl\/test\/junit\/jogl\/demos\/es2\/GearsES2.java;hb=HEAD#l297\">GearsES2<\/a>.<\/p>\n<p>This is currently impl. for X11 and Windows and I am currently adding these to our OSX port.<br \/>\nSince the default operation for these features are NOP and touchscreen don&#8217;t require any of those, there is no work to do on Android in this regard.<\/p>\n<ul>\n<li><a href=\"http:\/\/jogamp.org\">JogAmp<\/a><\/li>\n<li><a href=\"http:\/\/jogamp.org\/wiki\/index.php\/Downloading_and_installing_JOGL\">How to download and install.<\/a><\/li>\n<\/ul>\n<p>But be aware that these features will be promoted to the next release RC4,<br \/>\nso you would need to wait or use the autobuilds, see <a href=\"http:\/\/jogamp.org\/wiki\/index.php\/Downloading_and_installing_JOGL#Downloading_the_latest_automatic_build\">Downloading the latest automatic build<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After doing all the Android work, I thought I need a break and finally added the NEWT mouse features some are desiring: Visibility set pointer visible or invisible Confined confine pointer to window, or not Warp set mouse position within the window<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7,3,8],"tags":[9,16,44,17],"class_list":["post-365","post","type-post","status-publish","format-standard","hentry","category-3d-opengl","category-computer-stuff","category-jogamp","tag-3d","tag-java","tag-jogamp","tag-opengl"],"_links":{"self":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/comments?post=365"}],"version-history":[{"count":10,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts\/365\/revisions"}],"predecessor-version":[{"id":575,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts\/365\/revisions\/575"}],"wp:attachment":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/media?parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/categories?post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/tags?post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}