0

Im working on multiplatform applicaiton for mac and windows. Chose java fx as platform and started working on it. Once my app opens , user should not switch to any app without closing clicking on custom close button from user interface. Trying to disable three finger swipe(switching application and desktop). used scroll and swipe listeners to consume event but couldnot . Are there scripts which could be executed on os level through runtime or invoking script.

Also could not consume ALT+TAB events too.

Code below for ALT +TAB:

final KeyCombination kb =new 
      KeyCodeCombination(KeyCode.TAB,KeyCombination.ALT_DOWN );



        scene.setOnKeyPressed(new EventHandler<KeyEvent>() {
            @Override
            public void handle(KeyEvent event) {
                // TODO Auto-generated method stub

                System.out.println(event);

                System.out.println("KB:"+kb);
                if(kb.match(event)){
                event.consume();
                }

                label.setText(labelText+" \n Entered key "+event.getCode());



            }
        });
  • Apparently, you want to *get notified* when the swipe happens, which is entirely different from *disabling* it. So your title and your question do not match. Further, don’t tag your question with Swing when it isn’t about Swing. Besides that, ALT+TAB is handled by the operating system which doesn’t want applications to catch it, for the user’s sake. – Holger Sep 16 '19 at 10:24
  • I want to disable it(3 finger swipe). Changed question now, thank you. Using c# and .Net i have disabled ALT+TAB it in windows though. Want to know javafx supports it – surendra reddy Sep 16 '19 at 10:55
  • Possible duplicate of [JavaFX 2.2 Stage always on top](https://stackoverflow.com/questions/12819194/javafx-2-2-stage-always-on-top) – tevemadar Sep 16 '19 at 15:40
  • @tevemadar , Hi, Thats not my question, i want people not to switch to different apps, tried your solution, didnot work. – surendra reddy Sep 20 '19 at 03:16
  • Could you link how you did it in C#? That is what may or may not be translated to Java after all. – tevemadar Sep 20 '19 at 08:55

0 Answers0