'Input' does not contain a definition for 'GetMouseButton' how is this possible? - input

I've wanted to try developing for touch screen but for some reason it said:
'Input' does not contain a definition for 'touched'
Then I tried with the old fashioned way, which worked for me a million times, but now doesn't.
'Input' does not contain a definition for 'GetMouseButton'
Does someone know the source of my problem?
void Update() {
if(Input.GetMouseButton(0))
Debug.Log("Pressed left click.");
if(Input.GetMouseButton(1))
Debug.Log("Pressed right click.");
if(Input.GetMouseButton(2))
Debug.Log("Pressed middle click.");
}

Oh my god, I am so stupid.
I've already reinstalled Unity, VS and everything maybe twice.
And I didn't see what caused the problem...
The problem was that I named my script 'Input'
Oh my GOOOOD

Related

Keyboard shortcuts on Flutter web

I'm adding keyboard shortcuts to a Flutter web application.
I have a form within a custom FocusableActionDetector where the shortcut has form like this:
SingleActivator(LogicalKeyboardKey.digit2)
and action is like:
CustomActivateIntent: CallbackAction<CustomActivateIntent>(
onInvoke: (intent) { provider.value = "2"; },)
In the same form I have a couple of numeric TextFormFields. To permit writing the character "2" I have to put these text fields inside some new FocusableActionDetector, otherwise the previous detector catches the command and the text field loses the "2" character, and this is already quite weird... Moreover, after writing in any of the text fields the form focus detector doesn't work anymore.
I think this could be related to the focus system, which is yet not that clear to me.
Can anyone help find a clean solution?
I found a workaround: the FocusableActionDetector is now preceded by an if statement. The code looks like the following:
// I extract the form to a widget to make it clearer
var searchWidget = SearchWidget();
child: textEditingInProgress
? searchWidget
: FocusableActionDetector(
child: searchWidget,
...,
),
The textEditingInProgress bool is a field in a provider and is controlled by the FocusNodes belonging to the TextControllers.
Still this is not a perfect solution, in particular I'd like to understand why the previous approach was not working.

Need to lighten a color within the variables passed in a LESS mixin

I am currently updating the bootstrap source less files for a project and I have to modify the hover state for the buttons. The end goal is something along these lines:
.btn-primary {
.buttonBackground(#btnPrimaryBackgroundHighlight, #btnPrimaryBackground);
&.hover {
.buttonBackground( lighten(#btnPrimaryBackgroundHighlight, %20), lighten(#btnPrimaryBackground, %20));
}
}
However, that returns a compile error. Any thoughts on this issue? I'm sure it's something simple, but I'm at a loss. Thanks in advance.
P.S. - I will also be using the :hover pseudo-class, but for sake of example I'm using a simple class.
Put the percent sign after the number (20% instead of %20)

ExtJS/Sencha Touch 2 - How to grab an element/component with multiple classes in

I'm not sure if I'm going crazy. I've tested this on Kitchen sink also so it's not just me.
I've tried:
Ext.ComponentQuery.query('container[cls="blah"]');
Ext.ComponentQuery.query('container[cls~="blah"]');
But after it has a second class, it seems you can't get ahold of something by a class that it has.
Am I missing something or is this not possible?
If you go to http://dev.sencha.com/deploy/touch/e.../#demo/buttons
Ext.ComponentQuery.query('button')[0];
// returns element
Ext.ComponentQuery.query('button')[0].addCls('meep');
Ext.ComponentQuery.query('button[cls="meep"')[0];
// returns element
Ext.ComponentQuery.query('button')[0].addCls('blah');
Ext.ComponentQuery.query('button[cls="meep"')[0];
// returns undefined
Ext.ComponentQuery.query('button[cls~="meep"')[0];
// returns undefined
Because of what I expect and how the documentation words their DomQuery I think the above should work but is bugged.
I got around this by creating a new xtype and using that instead in ComponentQuery like so:
Ext.define('App.view.Deposit', {
extend: 'Ext.Container'
});
Ext.ComponentQuery('meep');
I guess I was trying to go about it like you would in jQuery, add a class and retrieve it using that, but with the Component stuff it's confusing.
I think this SHOULD have worked but it does not (tested in 2.0.1.1, 2.1.0b3):
Ext.ComponentQuery.query('button[cls*="meep"')[0];

Scale9Grid doesn't work in MovieClip

I have a couple of MovieClips in swf files loaded with Loader.loadBytes. They are 10-th version, as3-enabled and have scale9Grid defined (I can see the tag DefineScaleGrid in them with SWiX). But when loaded, loader.content has scale9Grid == null (maybe it is normal?) and scaling is not 9-slice. I can't even set scale9Grid myself - any attempt is met with exception "One of the parameters is invalid". How to make 9-slice grid work?
I finally found this article to explain it all. So, in short, scale9Grid works only on DisplayObjects without children. I dug down to Shape in my clip and managed to set that grid.

KERN-EXEC 3 when navigating within a text box (Symbian OS Browser Control)

I've had nothing but grief using Symbian's browser control on S60 3rd edition FP1. We currently display pages and many things are working smoothly. However, when inputting text into an HTML text field, the user will get a KERN-EXEC 3 if they move left at the beginning of the text input area (which should "wrap" it to the end) or if they move right at the end of the text input area (which should "wrap" it to the beginning).
I can't seem to trap the input in OfferKeyEventL. I get the key event, I return EKeyWasConsumed and the cursor still moves.
TKeyResponse CMyAppContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
if (iBrCtlInterface) // My browser control
{
TBrCtlDefs::TBrCtlElementType type = iBrCtlInterface->FocusedElementType();
if (type == TBrCtlDefs::EElementActivatedInputBox || type == TBrCtlDefs::EElementInputBox)
{
if (aKeyEvent.iScanCode == EStdKeyLeftArrow || aKeyEvent.iScanCode == EStdKeyRightArrow)
{
return EKeyWasConsumed;
}
}
}
}
I would be okay with completely disabling arrow key navigation but can't seem to do this.
Any ideas? Am I going about this the wrong way? Has anyone here even worked with the Browser Control library (browserengine.lib) on S60 3.1?
Update: Interestingly, if I switch to use Cursor Navigation, it works fine. For now, this is a workaround. I'm still curious to know if there are ways to resolve this.
You would get quicker answer probably in http://discussion.forum.nokia.com/forum/.
Interestingly, if I switch to use Cursor Navigation, it works fine. For now, this is a workaround. I'm still curious to know if there are ways to resolve this. For now, I'm calling this the answer.