focus

GWT FocusPanel, tab key and focus handlers

I'm implementing a custom widget extending Composite and implementing Focusable and HasFocusHandlers. The widget contains two widgets in a panel that I wrap into a FocusPanel that I use to initialize the widget. My constructor looks something like that: public CustomBox() { panel = new VerticalPanel(); ... panel.add(caption...

Java JFrame keeping focus when visible

Hello everyone, I am not sure if I have set the right title for this post - so it is possible that there's already a post for what I am looking for, if that's the case feel free to close this and redirect me - what I am trying to do is this: When a JFrame is poped the user not to be able to click anywhere else in the gui unless that win...

Chainable keyboard handlers in Swing

I have a custom component subclassed from JPanel, with a keyboard handler. My main application embeds this inside another JPanel. Now I want the parent JPanel to also respond to keystrokes, since there are some actions that need to be taken only when the component is focused, but which apply to the app as a whole, and not that component...

JavaScript: Key Event Handling after Assigning a Focus

So, I just learned html/css/javascript last week, so I am not too savvy with it, and I am currently working on an app that uses the keyboard for navigation. Anyways, I needed to create custom pop-ups and am running into a problem when trying to close them. To open the pop up, the user needs to hit 'ENTER' while selecting a menu item....

setting the focus in one user control based on an action in another user control

Hello One user control is a list box where each item in the list has a button. When the button is clicked, editable detail about the item is displayed in another user control. The detail knows what to display and how to display it via data binding to a view model. Both user controls are in the same window. The problem I am finding tric...

jQuery autocomplete focus next control

I'm using jquery autocomplete and want it to focus a specific control once an item is selected from the autocomplete list. I tried $('#nextelement').focus(), and it receives focus, but the focus goes back to the autocomplete control immediately. How can I retain focus to the next control when autocomplete closes? [edit] I'm using autoco...

Keyboard focus to list box items in wpf

Hi, I am having a list box, and its item template is having one check box. Now, when I click on the check box in the listbox, it sets the checked status of the check box. If I use keyboard "Space" key, I cannot change the checkbox state. Note: Keyboard is shortcut is working once I set focus to the check box by clicking it. ...

jQuery Textarea Caret Position to End on Focus

I have multiple textareas on a page and would like to set the position of the caret to the end of the text which changes per textarea (textareas do not contain similar length values). How would I initiate this on focus to move caret from the position they select to the end? Thanks in advance. -B ...

Clear background if content present in textarea (jQuery)

Please see this jsFiddle: http://jsfiddle.net/Wmq6f/ I have a textarea that has a background image, it is removed on 'focus' and restored on 'blur' but when the content is present in the textarea it should not show in either case, but I can't achieve that with this jQuery: $('textarea').focus(function() { var $this = $(this); $.d...

Page or Form First Control Focus Issue for dijit.Form.DateTextBox

I would like to inquire about the issue of dijit DateTextBox, When a DateTextBox is the first control in the page, the popup control is no longer shown since the toolkit probably waits for onfocus event to show the popup instead of the onclick. Is there anyway to make the first date textbox control to show the popup when the mouse is pl...

Programmatically move Cursor to a TextBlock

Hello, in my application I'm opening a Window as a dialog. Inside this window, there's a TextBox called "myText". When the dialog is shown, I want the cursor to be automatically inside the "myText" TextBox, so the user can immediately enter something without having to click in the TextBox. I however have problems realising this, can som...

How do I check if the window has focus?

I'm trying to do something similar to this... if (window.onblur) { setTimeout(function () { DTitChange(name) }, 1000) } else { document.title = dtit } The window.onblur doesn't seem to be working though, is there something I can replace that with? ...

Jquery: Perform function when user comes out of focus

I need to perform a function when a user comes out of focus. So far I can do it when they go into focus but how do I do it the other way round: $("input.default-value").focus(function() { $(this).css("color", active_color); }); ...

Cocoa, NSTextField not noticing lost focus when pressing Tab?

I can't seem to find a way to get notified when an NSTextField loses focus by pressing the Tab key. I get a nice textDidEndEditing when clicking another control or when pressing Enter, but not if I change the focus by pressing the Tab key. Also tried to yank KeyDown and doCommandBySelector for this purpose but I got nowhere. Any ideas?...

Select the content of textbox when it reveives focus

I have found a similar question to mine in http://stackoverflow.com/questions/97459/automatically-select-all-text-on-focus-in-winforms-textbox Now i am trying to modify or make it some more different by making it general. I want to apply same action to all the textboxes in form without write code for each one... how many i dun know. As ...

How to set Z-order of a Control using WinForms

I'm writing a custom TextBox that upon gaining focus changes its border style. As adding a border causes the control to overlap with those neighbouring it, I temporarily bring the text box to the front of the dialog (using textBox.BringToFront()). However, once editing is complete and focus is lost, I would like to send the control bac...

Instantiate form without losing focus on existing form

I have an application in .NET 2.0 on the compact framework. When I instantiate my custom form the current form that I have visible seems to lose focus. My new form isn't visible (I haven't called ShowDialog()) on it, but my current form loses focus simply by calling the constructor on my new form. Any ideas on how to work around this?...

java - losing focus

I have an applet which you can make a player 32 pixels in any of 4 ways using WASD keys. But when I add a textarea or label, I cannot move my image anymore. Something to do with focus. Code: /** Tile Generator Programmer: Dan J. Thanks to: g00se, pbl, Manny. Started May 23, 2010 **/ import java.awt.*; import java.awt.event.*; import j...

How to get an Alertdialog with the background out of focus (fuzzy).

I know how to make AlertDialog's of various types. But, how can I make an AlertDialog with the background fuzzy as if it is out of focus (i.e. like using a telephoto lens)? Whenever I search for 'focus' the result relaits to something like the onFocus commands, etc. which isn't what I mean. An example would be if you press the power bu...

how to build custom focusable object in HTML/JavaScript

I want to build a custom object in HTML which is focusable. How can I do that in general? More specific about why I want that: I need some kind of editor component with much more power and control over it. I.e. no single character should be possible to be typed in directly. It is like a big tree of objects (imagine an AST or so) and you...