Ability to choose your own "click" events in laser-controls? - aframe

Projects using the OculusGO or GearVR have a problem where the click event from laser-controls was triggered by BOTH the trackpad and trigger button click. Frustrating if you want different functionality for both (e.g. snap-turning on trackpad and click on trigger).
see line 74 (GearVR) and 79 (OculusGO) of https://github.com/aframevr/aframe/blob/master/src/components/laser-controls.js
cursor: {downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup']},
is there another way to do this or would it be worth having the option to select your own downEvents and upEvents in the laser-controls schema to forward to the various controller configs?

For snap turn you can listen to the button specific event instead of click:
controllerEl.addEventListener('trackpaddown', snapTurn);
You can also consider copying the laser-controls code to your my-laser-controls component and modify the downEvents array to your needs.

Related

Child controls in asp.net Blazor not refreshing. StateHasChanged() not working

Please refer to the following https://github.com/CD1010/BlazorWizard.git for this question. The sample is in StepActivations Branch
I have a page called DemoWizard, which incorporates a 3 step wizard. When i click the "Toggle Enabled" button, the second and third steps links should go to enabled or disabled state. It seems however, that the first time takes 2 clicks to turn off the headers, and the state is always behind.
So it appears that StateHasChanged() is not refreshing child states properly.
Note that the refresh() method was an attempt to get at least step2 to refresh properly, but to no avail.
Any idea why?
the click handler that does toggle is below.
void OnClick()
{
step2Enabled = !step2Enabled;
step3Enabled = !step3Enabled;
StateHasChanged();
Step2.Refresh();
}
Your code isn't showing up exactly as advertised, but i think what you need to do is add an event callback to the Blazorize CheckEdit component:
<Blazorize.CheckEdit #bind-Checked="#Parent.IsValid" CheckedChanged="#VerifyEnabledTabs">Check Me</Blazorise.CheckEdit>
where VerifyEnabledTabs is a method on the top level Wizard that can assess where you are and what is complete / filled / checked / whatever, to allow certain links to be active.

Event not Trackable in Google Tag Manager

I am trying to do a tag that measures the number of times an element is clicked.
I follow the following steps to create the tag
Tag Config:
Track Type- Event; Category- Button Click; Action;Non-Interaction Hit- False;
Add Trigger:
Click on some clicks:
Click Text>>Click URL>> Click Path
I follow the complete steps, but somehow I'm not able to track the events. Please, somebody, help me to find out If somewhere I was wrong or forgot to add some steps in this procedure.
In your example it seems that Action has no value.
If so, you should assign a value to Action because it is a mandatory parameter for events.

odoo 8 Button Logic

i'm new with Odoo 8. I added a Button in my module (inherit sale order) to be able to execute the method calkulateEKNew. The function is calling how it should be, but it looks like that the button is doing more stuff in the background. After clicking the button it saves the sale order and calls the method calkulateEKNew.
Is it possible to trigger this button or to find the logic behind the button ?
Nice regards
Buttons are available to execute python methods on the Odoo server.
If you want to execute JavaScript code, you'll have to add a (client-side) widget, possibly a template and a JavaScript file to your module.
This URL points to further information about simple widgets:
https://www.odoo.com/documentation/8.0/howtos/web.html#widgets-basics

bind button onClick method to keypress action

I have a button b, I want the document to understand a key press action has been triggered whenever I click on that button.
For example, when i click on that button, i want the document to recognize that the left key has been pressed and whatever the java script has been written for it should work.
I am unable to figure out how to do this. Please help.
You need to add an event listener to look for a click action. You can do this for a specific button, the first button that your code finds, or all buttons on the page if they all perform the same action. Actually, you can add this listener to just about any html object. Here's a simple snippet I got from https://developer.mozilla.org/en-US/docs/Talk:DOM/element.addEventListener.
<div id="ear">Click me</div>
<div id="display"></div>
<script>
var ear = document.getElementById('ear');
ear.addEventListener("click", listener, false);
function listener() {
document.getElementById('display').innerHTML = "blah blah";
}
</script>
What this is doing is creating a variable called ear, and assigning the div with id='ear' to it. Again, you can just as easily do this with a button, or any other tag. Then ear.addEventListener adds a click event, tells it to run the listener function, and the boolean at the end says if the parent's handlers should be run, as well all ancestors going up. Setting this to true will cause only the tag that was clicked to run.

Can't set custom startButtons and endButtons properties for super-hands reaction components

I'm attempting to utilise other button mappings for super-hands other than the defaults but I'm hitting trouble. For example, the abuttonup and abuttondown events for the Oculus Touch with progressive-controls.
When I use the following component, or any of the other reaction components, the grab-end or click events are not registering for custom button mappings.
clickable="startButtons: abuttonup; endButtons: abuttondown"
When I override the default startButtons and endButtons in the super-hands source, the buttons work as intended.
Many thanks.
The mappings I required have now been added to the aframe-super-hands library: Commit 95a3222

Resources