Autofocus functionality in C# window application - autofocus

I am implementing autofocus functionality of Nikon camera, but unable to perform autofocus functionality in C# Window application.
we are using this method but I got autofocus value is null.
// Auto focus
NikonEnum autoFocus = device.GetEnum(eNkMAIDCapability.kNkMAIDCapability_AutoFocus);
device.SetEnum(eNkMAIDCapability.kNkMAIDCapability_AutoFocus, autoFocus);
Currently we are taking help of this website to perform autofocus but we are not getting suitable answer.
https://sourceforge.net/p/nikoncswrapper/search/?q=autofocus&history=False

Related

Remove Browser Autofill feature

I need to remove the browser's autofill/suggestion feature.
This autofill is disabled using autocomplete="off" in Textfield component. once I do that this brings browser's auto fill feature
In Edge, If I turn off the "Save and fill the personal info" option in "Settings/Profile/Personal info" the above suggestion is not shown. Is there any way without turning off that setting I can remove the autofill feature using Material UI TextField property or CSS property "input:-webkit-autofill"
If autocomplete fails to work, most likely it's a bug or for some reason, react is preventing the attribute from being modified.
However, I know a simple way to bypass by changing the type attribute to something random, where the browser can't understand what it should ask from the user and therefore, the browser can't prompt an autofill.
For example on a standard HTML input tag:
<input type="inputText"/>
This will still treat it as an input field, however, it will not attempt to autofill.
Its browser functionality which you cant handle from code level. If you want to prevent it than you have to made setting changes in browser
Turning Off Autofill in Chrome
Click the Chrome menu icon. (Three dots at top right of screen.)
Click on Settings.
In the "Autofill" section, expand the area for which you wish to disable Autofill.
Toggle the setting OFF if it is on. The system will automatically save your settings.
More details found here => https://support.iclasspro.com/hc/en-us/articles/218569268-How-Do-I-Disable-or-Clear-AutoFill-AutoComplete-Information-
So for html you can simply put autocomplete="new-password" in your
Auto-complete="off" can also be used nut it has some drawbacks.
Banks and other security institutes turn auto complete off .Problem is user change frequently their passwords and fields and use simple passwords to remeber.So auto complete is good feature in these cases.
But you can try this solution if you want .I hope it will work fine
<input type="password" autocomplete="new-password">
you can add autocomplete="off" to your form or input but many modern browsers do not support autocomplete="off" for login fields
but you can prevent it using autocomplete="new-password"
Preventing autofilling with autocomplete="new-password"
for more information check this link
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#the_autocomplete_attribute_and_login_fields
Its most likely a bug, the solution I've found works best is to have auto-complete have a hard coded random value which will prevent a user from using auto-complete...
Try this:
<input type='password' name='pass' autocomplete='password' />
In terms of the auto-complete value you can have anything you want there.
New edit:
<script>
// Execute this code when page is
// totally loaded
$(document).ready(function () {
/* Setting the autocomplete of
input field to off to make
autofill to disable */
$("#name").prop("autocomplete", "off");
});
</script>

Force type="datetime-local" to act as type="text"

I want to override the default behavior of an input control.
I use <input type="datetime-local"> and it works almost fine for the user, with a pretty calendar and all. But for automated tests it's a nightmare.
Is it possible to patch the browser such that type="datetime-local" act as a type="text"? I would enable this mode during tests and solve all my problems.
I think I need this to be on the browser level because such tags are generated dynamically all the time via vue.js so a one-time attribute replacement won't work. I use the latest chrome version.
Update
I need to bypass the fancy data-editing that is almost-locale-dependant. If I can set the value of the control to 2018-06-12T19:30 I will be happy. This is actually the fallback behavior on browsers that don't support datetime-local.
This cannot be javascript based on a control by control basis, since the page is accessed via browser-driver and selenium.
Try to put this in JS
var d = document.getElementById("date").value;
var n = d.toString();
And then use n

Html input number is not getting numeric keyboard input

Here is the input type number
<input type="Number" id="yPos" />
it is working fine and i am able to change it through mouse
But it is not getting numeric input from keyboard. How can i enable it?
Edit:
I found that UnitywebGL is creating this problem otherwise the keyboard input is working correctly in html controls.
Actually there is no issue with the html input field. It was related to the unity webgl:
Keyboard input and focus handling. By default, Unity WebGL will
process all keyboard input send to the page, regardless of whether the
WebGL canvas has focus or not. This is done so that a user can start
playing a keyboard-based game right away without the need to click on
the canvas to focus it first (source).
So the Unity canvas was consuming my all keyboard input. No matter I tried to enter/select my input control, it will not get input from keyboard. So I used
WebGLInput.captureAllKeyboardInput
to activate/deactive unity canvas input based on user selection.
First, correct the form. The type should be "number" without caps, i.e:
type="number"
Also check if you have turned off the num lock.

Hide autocomplete verbose logs in console

Is it possible to hide [DOM] Input elements should have autocomplete attributes messages inside chrome's console? I don't want to add autocomplete to inputs of my web app and now my console is overpopulated with verbose messages which aren't relevant to me.
EDIT: This question is not duplicate of this question, since I want to show everything, except autocomplete warnings.
Just add autocomplete="foo" for each input and they'll all dissappear, for example:
<input id="client-address-info" type="text" maxlength="80" autocomplete="foo">

Tabbing does not work in a chrome extension

I am trying to build a simple login form in a chrome extension. In my popup.html, I have a few input fields that have their corresponding tabindex values set. The username field has the autofocus property set through HTML or $('#myelement').focus() (I've tried both methods).
For some reason, tabbing does not work on my form when I first click the button next to the omnibar to open the popup. The username field has focus, but pressing the tab key makes the cursor disappear. It only shows up again if I explicitly click one of the input fields and then tab over, but never when they popup first opens.
<input type="text" id="one" tabindex=1 autofocus />
<input type="text" id="two" tabindex=2 />
If I open popup.html in a web browser (and not the extension), I've noticed that the tabbing in my form works perfectly.
This is a regression, which has a bug filed here. Unfortunately it has been around for quite some time now, and there doesn't seem any progress on it.
There is no known scriptable workaround for this bug.