Set focus on entry that is not visible in pyGTK - pygtk

I want to set focus on entry that is not visible in pyGTK for a barcode scanner.
If I set entry to visible false then I get this error when setting focus on it.
/home/samuel/visitors-book/visitors_book/__init__.py:60: GtkWarning: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
gtk.main()
Thanks Sam

You could do without a GtkEntry and capture the keyboard events directly.
But is it so bad to have the entry visible? All barcode terminals I've seen confirm what is read.

Related

Insight tool shows error icon, but shows message "No failure was detected"

I am using a tool for verifying if app is compliant with windows accessibility feature
Tool web link - https://accessibilityinsights.io/downloads/
Test tool have simple MFC combo box .
Tool says "No Failure was detected",
Insight tool shows a error icon.
Below are steps to get above state.
Launch app
Launch Insight tool
select what to test = element
Mouse hover on combo box
expand the combobox
mouse hover on item
click on brush icon on right
It will enter the state described abovewith no error but with error icon
Isolation:
Issue doesn't repro when "Entire App" is selected.
When "Entire App" is selected, tool does not show any error or any error icon. App pass accessiblity
Question is if this tool is reporting valid error ?
What is the error as tool says " No failure was detected."
What you're seeing here is an artifact of trying to capture a transient state. Combobox content goes away when the combobox closes, and that happens as soon as you start the scan. Accessibility Insights for Windows allows you to trigger a scan using a timer, as documented at https://accessibilityinsights.io/docs/windows/getstarted/automatedchecks/#running-automated-checks-with-a-timer. The "short version" is that you start the timer, then open the combobox while the timer is counting down, and the checks will run when the timer reaches zero. The combobox will still be fully opened at this point, so the tests will apply to the combobox contents.
My personal recommendation is to set the scope to the entire application when using the timer, just because transient controls sometimes have multiple layers and trying to have the scope of just the element can tend to hide children of the layers in question.
Thanks for using Accessibility Insights
--DaveTryon
Accessibility Insights team

In IE elements are get hide then after hover on them they get visible

I am working with IE11. After loading my website elements like checkbox, radio button, drop down arrow get automatically hidden then after hover on them they get visible then after click anywhere in page they again get hide. All this element are present and style are applied tested with developer tool but still they was giving problem. Then after check "use software rendering instead of gpu rendering" option from settings->Internet option->Advanced->"use software rendering instead of gpu rendering" everything got ok. Now my website element not getting hide all style applied perfectly. But I doesn't understand why this happen? How this setting fixed issues. Please any idea help!

Program to respond to Keycodes while minimized

I need a program to respond while not active/not selected by user or minimized to KeyCodes.
Anyone got ideas? In VB.NET.
This won't work out of the box as key messages are only sent to the active window. A minimized window is never active.
What you could try is register system-wide hotkeys. You could also try to install a keyboard hook, however, this would affect the entire system and your application would receive all the keystrokes performed. This would require efficient filtering.

Check if software keyboard is open in Windows Phone 8?

I want to check if the software keyboard is open in Windows Phone 8. I have found some sparse information that this is possible using CoreWindow.IsKeyboardInputEnabled, but I can't find any way to implement this. I have found sample code only for C++, which I don't understand at all.
I use VB, however I can read C# enough to figure it out if I can get a C# example.
Whatever I do I always get a null/nothing value. The following code compiles and runs, but c is 'nothing' when the app crashes at the if c.IsKeyboarInputEnabled... line.
Dim c as CoreWindow
c = CoreWindow.GetForCurrentThread
if c.IsKeyboardInputEnabled then...
I know I need to give 'c' a value, but can't figure out how. I've also tried:
Dim c as CoreWindow = New CoreWindow
which the editor flags as an error and thus won't compile.
If it's relevant, what I am trying to do is ensure my navigation is consistent. Currently, a tap on a particular screen element should close that element. However, if the keyboard is open, I want that tap to simply close the keyboard and leave the tapped item open. I believe this is the more intuitive and consistent approach for the user.
I think the only way to achieve this functionality is to know if the keyboard is open before determining what to do with any open panels.
e.g.
[when screen tapped and a popup is expanded]
If [keyboard visible] then [close keyboard] else [close tapped item]
I don't think there is any official API to detect the opening and closing of the SIP but one workaround might be to check if any of your TextBoxes have focus.
You can do this by overriding GetFocus and LostFocus for each TextBox.
To close keyboard, just set the focus to the ContentPanel(or any other grid).
Let me know if this works.

VB Clear keyboard buffer

i know my question seems very similar to others according to a buffer-clear issue... but here is a detailed description:
I have an motorolla handheld (bar-code scanner) which is reading barcodes over an tray tool.
The code is scanned by the traytool und is casted as an keystroke like a normal press on a key on a keyboard.
so i have an app in vb which should read a barcode and after that a second and than proceed the inputs.
after reading 12 chars/numbers my textfield should set the focus to an other textfield (2. barcode) so i check onChange the length and than set the focus to the next textfield.
if there is a malicous barcode or a barcode which contains more than 12 characters/numbers the second textfield will be filled with all chars after the 12. char from textfield 1.
i have no control over the scan behaviour or the keydown event of the scanner trigger... nothing possible.
also there is no termination symbol in the input data which signals me that one block is ending here.
so how is it possible to clear the buffer of the virtual keyboard of the scanner ?!
any suggestions?
I suggest downloading the manual for your scanner to find the configuration codes. They are typically a set of special barcodes that can be scanned to set properties such as allowed symbologies. What you will want to do is set the scanner so that it appends a CRLF, Tab, or other terminator for your data. That way you can act upon the end of the barcode.
You can use TWAIN to handle the scanning thought i am not sure whether it supports Motorola. Try to download some TWAIN libraries and in-cooperate them with your project.