Enable/Disable VRTK Teleport at runtime - vrtk

i am using VRTK with HTC Vive, on controller button pressed i want to disable Teleport, can anyone please share their experiences.
regards,
Jithendra.

To disable the teleport you have 2 options.
You can either set the Enable Teleport flag on the destination marker (e.g. the pointer) to false, then whenever you use the pointer and click the selection button it will emit the destination event but the teleporter will ignore it.
Or you can simply disable the teleport script, so something like MyTeleportScript.enabled = false which will just unregister the teleporter from the scene.

Related

Filter events globally in KONVAJS

Is it possible (e.g. by overwriting a prototype) to filter (enable/disable) events globally in KONVA?
use case:
I have an interactive app built with KONVA. At the beginning, I want to show a "demonstration" of the user interface: I'm displaying a moving second mouse cursor and fire events which are handled by the app to demonstrate possible interactions. All is working, but during the demonstration, the app should not listen to real mouse events, only to the simulated ones (having a special property set in event object).
For that use case, just set listening: false for your stage. It will disable ALL events on the stage and its children.
You can turn off events just for demonstration. As soon as it is done, you can turn mouse/touch/pointers events on with listening: true.

JavaFX: Disable all Buttons from a ToggleGroup

Like the title says, i want to disable all Buttons in a Togglegroup. I know it is possible to select the Buttons individually and button.setDisable(true).
But is there a possibillity like group.setDisable(true)?
Thanks for any help or hints.
Greetings
If all the toggles are in the same container (Group or Pane), and there is nothing else in that container (at least, nothing that you care about being disabled, so Labels might be OK), then you can just disable the container (the disabled state propagates to child nodes).
Otherwise there is no direct way to do this: you can just iterate through the toggles, use the appropriate cast, and disable it:
toggleGroup.getToggles().forEach(toggle -> {
Node node = (Node) toggle ;
node.setDisable(true);
});

Android: Add Custom keyboard to Xamarin.Forms

I am working on a Xamarin Forms project.
We are testing a Android Device running KitKat that has a 12 key keyboard.
I am trying to force the softinput keyboard from showing when focus is given to an Entry for which I created a custom Renderer which overrides the FocusChange and Clicked events.
It kinda works as I detect if the device has a physical keyboard and if the entryKeyboard is numeric. If both those conditions are true, I call
Control.ShowSoftInputOnFocus = false;
AND
imm.HideSoftInputFromWindow(Control.WindowToken, HideSoftInputFlags.None);
It mostly works, except when the view containing the Entry editor opens. the keyboard is shown for a few moments and then it disappears. That's a problem on 2 fronts. It moves up the buttons that end up at the bottom of the view while the keyboard is measured, so buttons appear, move up and then back down when keyboard ultimately disappears. Second, once in a while it doesn't work. We have put a few delays, but that only compounds the problem since the keyboard ends up on screen longer.
In a perfect world, I don't care about the delays, I just don't want the softInput to show up anywhere in this view unless I specifically ask for it,
Alternately, I would not mind writing my own invisible keyboard and have to show (invisibly) while the async process is performing.
I have been searching everywhere for a while, so any help would be greatly appreciated.
thanks in advance and have a nice day
I think you need to make a custom renderer for your EditText's. Then also create your own implementation of EditText which overrides the OnCheckIsTextEditor method, which simply returns false.
If you are only targeting Android API 21 and up, you can alternatively just call ShowSoftInputOnFocus = false on all your EditText instances. This could probably be done with an Effect in Xamarin.Forms.

Handsontable edit on mobile device

i know that handsontable is not mobile friendly but is there a workaround that we can edit on mobile devices with the newest version?
Regards
I use Handsontable version 0.25.1, but I imagine the situation is still the same at the very latest release.
My experience is only with iPad device (iOS 9); I cannot speak about all mobile devices.
I found the rendering acceptable. But if you tap a cell to edit nothing happens, which is rather limiting! I made just two small changes to rectify:
Tracing all of this right down in handsontable.full.js, the logic in onCellMouseDown() is testing for event.button === 0 (i.e. left mouse button) to start setting up for recognising the double click to activate the mobile text editor. On a touch device, they are explicitly calling their onMouseDown/Move/Up() from their onTouchStart/Move/End(), passing the mouse events the event structure received for the touch event. However, touch events' event structure does not have a button member, so that is undefined, causing bad behaviour.
Directly setting passed-in event.button = 0 before passing to mouse event handlers solves this. Put in line:
event.button = 0; // set as left mouse button
into onTouchStart() [prior to call to onMouseDown(event), around line 1326] & onTouchEnd() [prior to call to onMouseUp(event), around line 1368].
Now tapping into a cell correctly allows editing. It brings up their MobileTextEditor. Which I did not like for a number of reasons, including the fact that often it appears behind the on-screen keyboard so the user does not even know it is there! I changed their Handsontable.TextCell [around line 4346] so that the editor: line now reads:
editor: (isMobileBrowser() && Handsontable.useMobileEditor) ? getEditorConstructor('mobile') : getEditorConstructor('text'), // only use mobile editor if explicitly called for
So it uses the standard in-place text editor, which I prefer, unless you go hot.updateSettings({useMobileEditor: true}).

Cocoa listening key events and responding them without view

First of all hi guys!
I was trying to write a mouse controller app for mac os x which is reading inputs from keyboard and moves the mouse accordingly. By garbage input i will describe the input was intented for a mouse event but it creates text on screen.
Before anyone points to the fact that there is a built in one, It was laggy even in shortest lag setting and cannot registers more than two buttons at the same time (you have to press diagonals to go to the diagonal.) If you accidentally press another button when release of the accident button your motion stops. My first and last reaction was "rubbish!". Adding customization and extra features is my goal.
I want to create a key combination that will block the garbage input to be passed to other programs while it was held. But global monitoring and seems like it always passes the event. And unfortunately I see qqqqqqqwwwwwww like text in unwanted places.
I want to see that when i press q w and up, it will make the mouse go up. But i create qqqqqqqwwwwww mess on the way. My first idea was creating a view on popover and handle events there, but whenever I want to use my mouse from keyboard seeing a popover is anoying and I couldn't find a way to show the popover without leaving any garbage keyboard input.
What should i do in this situation?
You will want to use Quartz Event Taps. Note that for an application to tap keyboard events, it has to be trusted for accessibility (as in System Preferences > Security & Privacy > Privacy > Accessibility). Your app can ask to be made trusted using AXIsProcessTrustedWithOptions().

Resources