Questions tagged [focus]

Focus indicates the component of the graphical user interface which is currently selected to receive input.

Focus indicates the component of the graphical user interface which is currently selected to receive input. Text entered at the keyboard or pasted from a clipboard is sent to the component which currently has the focus. Typically, the focus is withdrawn from an element by giving another element the focus.

The concept is similar to a cursor in a text-based environment. However, when considering a graphical interface, there is also a mouse cursor involved. Moving the mouse will typically move the mouse cursor without changing the focus. The focus can usually be changed by clicking on a component that can receive focus with the mouse. Many desktops also allow the focus to be changed with the keyboard. By convention, the tab key is used to move the focus to the next focusable component and shift + tab to the previous one. When graphical interfaces were first introduced, many computers did not have mice, so this alternative was necessary. This feature makes it easier for people that have a hard time using a mouse to use the user interface. In certain circumstances, the arrow keys can also be used to move focus.

7243 questions
3
votes
1 answer

WPF: KeyboardNavigationMode.Contained doesn't work to suppress focus wrap

I want to navigate in my window with the arrow key. It works so far but if I reach the end of my window, focus wraps to the first main menu item. But I want that focus stops at the last control in my window. private void Window_PreviewKeyDown(object…
codymanix
  • 28,510
  • 21
  • 92
  • 151
3
votes
3 answers

jQuery on keyboard backspace move to previous input field if becomes empty

I have this jQuery script: $(document).ready(function() { //Focus the first field on page load $(':input:enabled:visible:first').focus(); //Clear all fields on page load $(':input').each(function() { this.value = ""; …
David
  • 1,171
  • 8
  • 26
  • 48
3
votes
1 answer

Capturing keypress, directing to specific element in Chrome

I am building a chat application and I am trying to make sure that any time a user presses a key, the key they press ends up getting entered into a specific element (an editable HTML document ui.rte1Content in an iframe ui.rteIFrame, to be exact). …
Swiftheart
  • 443
  • 1
  • 5
  • 17
3
votes
0 answers

java popup menu has no focus with VK_CONTEXTMENU

I am incorporating a popup menu in my java application. I have added a mouse listener to show it up and I have also registed a keyboard action with the key event KeyEvent.VK_CONTEXT_MENU, that brings it up as well. Problem is that the popup has no…
aviad cohen
  • 637
  • 1
  • 6
  • 16
3
votes
2 answers

JButton & Action & KeyBinding

I have created a JButton class that recieving Action, the JButton class includes keystrokes & mouse listener so i can use the same class in multiple frames as needed. My problems is that: JButton not getting the focus when pressing the key, but it…
Motasem
  • 599
  • 1
  • 6
  • 13
3
votes
1 answer

How to disable Edit control's focus on Dialog first launch?

Hello everybody reading this. Thanks in advance for your time. One thing before question: I DO NOT use neither MFC nor Windows Forms, just WinApi in C++. Well, I am making a polynomial calculator in Visual C++. I added a Dialog to it, which was…
bercik
  • 164
  • 12
3
votes
2 answers

Binding RadioButton IsChecked to ListBoxItem IsSelected and ListBox IsFocused

I've seen other questions very similar to this but somehow I still can't get it working. Here is the scenario. What I have I have a ListBox that displays a list of my view models. Each view model has a list of children that are displayed in…
Kelly
  • 3,292
  • 1
  • 24
  • 24
3
votes
2 answers

jQuery datepicker input not loosing focus on chrome

I have an input that is using jQuery UI datepicker, upon selecting a date the datepicker closes and then i make an ajax call to get some data back and refresh a datagrid. Somehow, after the datagrid finishes refreshing the datepicker auto open's.…
mfreitas
  • 2,395
  • 3
  • 29
  • 42
3
votes
1 answer

how can i focus and move scrollbar in listview

I have a ListView and I do some select on the selected change event private void seleccionarIndexEnLista(int i) { lstvClientes.Items[i].Selected = true; lstvClientes.Items[i].Focused = true; } but if the selected item…
Cristo
  • 700
  • 1
  • 8
  • 20
3
votes
2 answers

WPF: Controlling focus in a custom control

I am developing a custom control (say BoxControl) which will have many controls in it like a textbox, few buttons etc. I will have many BoxControls in a row and while navigating via tabs, I want it to behave like when a BoxControl gets focus, it…
Arpit Khandelwal
  • 1,743
  • 3
  • 23
  • 34
3
votes
1 answer

mouse wheel scroll horizontally

I have a panel whose AutoScroll = true; I can scroll the panel using scrollbars. I also find mousewheel "vertical scroll" with "mouse" wheel by writing: void panelInner_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e) { …
Birol Capa
  • 349
  • 2
  • 6
  • 18
3
votes
1 answer

ListView OnFocusChangeListener

I have a ListView in a ListFragment and I want to change the background of the fragment when the user changes the focused item in the list. I specifically say focus here because this is a Google TV app so I'm targeting dpad controls and item…
rharter
  • 2,495
  • 18
  • 34
3
votes
2 answers

Optimizing AngularJS directive that updates ng-model and ng-style on focus

I'm new to AngularJS and I'm making made a couple of custom Angular directives to do what I used to do with Jquery, however there is one case where I'm not sure if I'm doing it the "the angular way". It works but I think there might be a better…
3
votes
1 answer

surf in two listviews and lost focused

I have one fragment activity include two list fragments. I use D-pad to moving through lists. For example, when I click on listview1->tv, in listview2 shows tv channels . When I click listview1->movie, in listview2 shows movies list and so on. So…
Mohsen
  • 61
  • 1
  • 5
3
votes
2 answers

WPF Focus Navigation Wrapping

Is there a way to force Focus Navigation (as controlled by the Tab key or MoveFocus method) to wrap inside a given container? I have included code which demonstrates this problem below. What is the easiest way to make Tab move focus from TextBox…
Joseph Sturtevant
  • 13,194
  • 12
  • 76
  • 90
1 2 3
99
100