What to consider a click? [closed] - conventions

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Such a simple consept, yet so many ways to interpreit it.
I'm making a program (a game, to be spesific) using an event based library (Allegro). The library doens't have a spesific event for a mouse click, but in stead has event for button down and button up. While programming the basic menus, I was struck by a problem. What do I consider a click? The button down event? The button up event? The latter, if it happen shortly after button down? If so, from which point do I take the cursor position from?
There is no dragging functionality anywhere in the program, so all options seem equaly valid to me, with the exception of the most extreme cases perhaps (dragging the cursor long ways across the screen, for example). So my question is, are there any conventions to what to consider a click?

If you experiment with buttons in various programs, you'll probably find that the button triggers when you press and then release the mouse within it.
More specifically, when you press the mouse, the button switches to a "pressed" appearance, but if you drag the mouse outside the button, the button reverts to its normal appearance, and releasing the mouse then has no effect. There is probably also another state that the button is in when you hover the mouse over it.
For a user accustomed to modern interfaces, you really need to provide all three of these states - normal, hover, and press - in order to give them the feedback they expect for a pressable item.

Related

Insert Data in a popup modal and refresh data in the parent [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have a window in JavaFX, which contains a TableView. When I click on it, it opens a modal pop-up window. In these window you can insert data and submit it in a database.
Each window has its FXML controller.
I want to refresh the tableview embedded in the parent window of the popup. Do I have to use the focused property of the parent window ? I don't know which event to use or which method to call between controllers.
If you are using a MVC pattern, I would suggest you to:
Create a model where you instantiate your database; that database will be an ObservableList<CustomItem>, where CustomItem is the data container representing a line of your table.
In your model, create an updateItem method which changes information for one item of the list
Link your TableView to the list using tableView.setItems(obsList)
In your pop-up window, create a SUBMIT button; the setOnAction method of that button will call updateItem(CustomItem yourSelectedItem). Then your TableView will be automatically updated.
Hope it will be helpful.

Mouseup programmatically in Qt?

Background
I'm building an application which runs in the background, and where the mouse cursor is moved programmatically into a dialog when the dialog "pops up". I have done this using QCursor.setPos
Problem
The problem I'm having is that if the mouse button is pressed down when the user is interacting with something outside the application this might lead to unwanted things happening. For example if the user is changing the volume and the mouse is moved the volume might go to max or min
Question
Is there any way (in Qt) to do a mouseup programmatically?
If I do this before changing the position of the cursor it seems to me that there is less risk of problems (though there might be other problems resulting from this approach)

Autoit MouseClick not successfully clicking [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am attempting to make an automation for a browser game on kongregate, minequest. I've created a code that is supposed to click a series of buttons however while the mouse moves, the mouse doesn't always successfully click. No errors are given and each time I run the code different clicks fail. I have tried adding more and more time between clicks to the point that I now have 1 second wait times, repeat the clicks at least twice, etc. to try to ensure a click happens but clicks still don't always happen.
I have windows 10, mouse pointer scheme is set to none, I am using google chrome as the browser.
Edit: FYI I have made other automations that work just same with the same browser, same computer, etc. I currently have gotten this code working by having it click 10 times instead of 1 but that shouldn't be necessary and I would like to understand why this phenomenon is happening.
I had a very similar problem, and it turned out that some programs didn't register my clicks because by default, Autoit only holds down the mouse click for 10ms, which wasn't long enough for it to register on some programs.
Setting
Opt("MouseClickDownDelay",50)
fixed it, by increasing the length of each click to 50 milliseconds.
Sometimes an application might not react on "click", but on "button status". MouseClick might not have enough time between "Press" and "Release" for those applications to notice that the button is "down". (Your description ("working one time out of two to ten") supports this oppinion). To give that application a proper "Button is down", a mousedown, sleep, mouseup sequence should work.
If you don't have trouble with a mouseclick "by hand", a sleep time of 100 - 200 ms should be fine.

Is the WAI-ARIA role="radiogroup" wrong, when autosubmitting on selection

Background:
I am brushing up accessibility in this application.
The user must select one of the supplied answers to a question. The answers can be navigated between using the arrow keys on the keyboard.
When the user presses space or enter, the choice is made, and a new set of questions appear.
My question to stack overflow:
Is role="radiogroup" and role="radio" incorrect to use here, since it autosubmits and moves to the next question set?
Does radiogroup imply that the user would be able to change their answer before pressing a submit button?
If yes, what would be a better way, to indicate to a read speaker what this is?

in Qt how to know which component (placed on a widget or form ) is currently focused?

I am doing work on Qt. i am not using android. It's just a desktop application running on windows/linux.how to know which component (placed on a widget or form ) is currently focused ?
i have onscreen keyboard which appears when a QLineEdit,QTextEdit or QPlainTextEdit get focused and hide when these lost focus.But when i switch focuse from one TextEdit(or lineEdit,PlainTextEdit) to Another TextEdit(or lineEdit,PlainTextEdit) my keyboard hide and again show.I just want to stop this
If you want to stop the keyboard from flickering when the widget it's coming from and the one it's going to are similar then you could perhaps implement a timer. I imagine you have the lost focus signals going to your code that is hiding the keyboard. Instead of really hiding it, you can start a timer like
QTimer::singleShot(500, this, SLOT(really_close_keyb()));
Within that really_close_keyb() slot you could implement code to check if the widget that currently has focus should have a keyboard or not, and if it should then you don't hide it.
With this your keyboard will be up for 1/2 sec after the user focuses out of a line edit, giving enough time to focus on another one without losing the keyboard. Adjust the timing to suit.

Resources