Input.GetAxis("Vertical") returns -1 by default in Unity 4.2 - input

I had a code in Unity UnityScript, it was working in the morning, and I did not change anything.
Now I opened Unity again, it asked "do you want to update Unity?" , I say yes, now it is downloading UnitySetup-4.3.1.exe in Chrome. This may be relevant to the issue.
Anyway, now I ran my code, and noticed something unusual.
changed my code to this :
function Update()
{
Debug.Log(Input.GetAxis("Vertical"));
}
it prints -1, although I'm not pressing anything, or none of my keys are stuck.
I tried restarting Unity. Changing my code back and forth, so it "rebuilds" (hopefully) the application. None of them worked. Maybe there is some other way to refresh the project ?
Has anyone faced an issue like this? Any ideas for a solution?
Thanks for any help !

I know this is super old question but the same issue faced me with Unity 5.3.3f1, just navigate to Edit -> Project Settings -> Inputs
You'll find 4 (Array Element) for both "Vertical" & "Horizontal" 2 each, delete the duplicate ones and you're good to go.

This is expected. As per the documentation here:
The value will be in the range -1...1 for keyboard and joystick input.
If the axis is setup to be delta mouse movement, the mouse delta is
multiplied by the axis sensitivity and the range is not -1...1.

Installing the latest version (4.3.1) and restarting Unity solved the issue..

Related

Fancytree Tooltip API

I have been using Fancytree quite successfully for several years. Of late a new requirement has arisen. I would like to change the tooltip for a node that is currently visible. Is there a way to do this? How? Using an API? I have tried changing the tooltip property of an existing Fancytree node. Strangely, this did not work. What will work? Thank you.
Over on Github, this was resolved by Mr. Wendt. He suggested calling node.renderTitle() after modifying node.tooltip (which was correct) and he found a typo in my code. See Github issue #1093

Blue border started showing around cell after iOS 13 update, how to get rid off it?

I am going to try be precise about this problem.
I am fixing some old mail application written in objective c long time ago, and it worked pretty fine before this new iOS 13 update.
After that, it starts to show a blue border around body cell (where I have to type message).
I read about focus ring and it seems like same issue, but I was not quite sure because I did not see initialized it anywhere in my code.
Did anybody have a similar issue?
Thanks
It looks like this
I found an answer:
you need to implement these lines in your application:
[self.wkWebView stringByEvaluatingJavaScriptFromString:#"var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '*:focus{ outline:none }'; document.getElementsByTagName('head')[0].appendChild(style);"];

Ported OSX Obj-C/CG Screenshot Code to js-ctypes - crash on final line

I ported some objective-c/CoreGraphics code that takes a screenshot of multiple monitors but it's not working. The jsctypes guys won't be able to help because the section is just me answering questions lol
The objc/cg code is from here: https://stackoverflow.com/a/28247749/1828637
My jsctypes type/struct/declares are here: https://github.com/Noitidart/NativeShot/blob/mac-troubleshooting/modules/ostypes_mac.jsm
The jsctypes port is here: https://github.com/Noitidart/NativeShot/blob/mac-troubleshooting/modules/workers/MainWorker.js#L443-656
And the last line is line 643 which causes the crash:
var rez_writeToFile = ostypes.API('objc_msgSend')(data, ostypes.HELPER.sel('writeTofile:atomically:'), myNSStrings.get(OS.Path.join(OS.Constants.Path.desktopDir, 'full_ss.png')), ostypes.CONST.YES);
This coincides with the objectivec of
[data writeToFile:#"/tmp/screenshot.png" atomically:YES];
except i changed path to ...desktop/...png
I wrote to sepearte gists, to align the lines in text diff software to make sure I did everything.
Here is objc/cg: https://gist.github.com/Noitidart/8affcd8bee60d22dcb52
and here is jsctypes: https://gist.github.com/Noitidart/3d4a4e8df625dbea8cc1
I dont think i missed anything i dont know why it crashes on that final line
Do any of the ObjC/CG people see any type definition that is wrong or something that I missed (for example the ObjC code uses compound statments I'm not sure I understood/translated them correctly in the port).
Wowww so after struggling for like some hours then posting this I realize it right away haha
Casing typo in selector!! I had writeTofile:atomically instead of writeToFile:atomically!
If anyone would like to test this out, it's a simple firefox addon test case.
Install an addon that allows installing addons from github repos from here: https://addons.mozilla.org/en-US/firefox/addon/github-extension-installer/
Go to commit on this branch that works here: https://github.com/Noitidart/NativeShot/tree/f5f2e8606d3c5c657e901239d3ceb8c8c79a4494
Then click the "Add to Firefox" button at bottom right, below the "Download Zip" button
Click on the toolbar button icon that gets added to firefox, as seen in this screenshot: http://i.imgur.com/n7lSxje.png
Check desktop you now have a single png file with a screenshot of all the monitors, huge props to #KenThomas!

dojo.dnd.move node rendering issue

Dojo has a basic issue, amongst other things... with its dojo.dnd.move class. The issue which you can see here:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/tests/dnd/test_parent_constraints.html
Is that when you click on a node, and start dragging, the node itself jumps. It actually moves its position. This is extremely problematic and I was wondering if anyone has seen this happen before.
I am creating an application that requires the moving of nodes but it needs to be precise and thus can't have the initial jump.
Any help would be greatly appreciated.
This is caused by the following highlighted code in Mover.js:
https://github.com/dojo/dojo/blob/master/dnd/Mover.js#L91-92
The odd thing is, based on the comments, it seems like this code is causing the very problem it aims to prevent.
That said, if your body has padding: 0 applied to its style, this code shouldn't affect you. (You can test it on that test page by running document.body.style.padding = "0" in the console before dragging.)
You might want to enter a ticket on the Dojo bug tracker at http://bugs.dojotoolkit.org (or maybe search and see if one has already been entered for it).

Problem with QSqlTableModel -- no automatic updates

After setting up a table model in Qt 4.4 like this:
QSqlTableModel *sqlmodel = new QSqlTableModel();
sqlmodel->setTable("Names");
sqlmodel->setEditStrategy(QSqlTableModel::OnFieldChange);
sqlmodel->select();
sqlmodel->removeColumn(0);
tableView->setModel(sqlmodel);
tableView->show();
the content is displayed properly, but editing is not possible, error:
QSqlQuery::value: not positioned on a valid record
I can confirm that the bug exists exactly as you report it, in Qt 4.5.1, AND that the documentation, e.g. here, still gives a wrong example (i.e. one including the removeColumn call).
As a work-around I've tried to write a slot connected to the beforeUpdate signal, with the idea of checking what's wrong with the QSqlRecord that's about to be updated in the DB and possibly fixing it, but I can't get that to work -- any calls to methods of that record parameter are crashing my toy-app with a BusError.
So I've given up on that idea and switched to what's no doubt the right way to do it (visibility should be determined by the view, not by the model, right?-): lose the removeColumn and in lieu of it call tableView->setColumnHidden(0, true) instead. This way the IDs are hidden and everything works.
So I think we can confirm there's a documentation error and open an issue about it in the Qt tracker, so it can be fixed in the next round of docs, right?
It seems that the cause of this was in line
sqlmodel->removeColumn(0);
After commenting it out, everything work perfectly.
Thus, I'll have to find another way not to show ID's in the table ;-)
EDIT
I've said "it seems", because in the example from "Foundations of Qt development" Johan Thelin also removed the first column. So, it would be nice if someone else also tries this and reports results.
I use Qt 4.6.1 in PyQt and the problem is still here. Removing "removeColumn(0)" solves the issue.