focus

Newbie Help with jQuery checking for focus

I am new to jquery and am trying to fire a function on a keyPress if there are NO inputs selected. but I am having trouble with testing for focus. Below is what I currently have but it isn't working correctly. Any advice? var inputHasFocus = false; $('#myForm :input').each(is(":focus")){ inputHasFocus = true; }; if (inputHasFoc...

Prevent WebBrowser control from stealing focus?

Is there a way to stop the WebBrowser control from causing its parent form to bring itself to the front? If you use the InvokeScript method to invoke a JavaScript function that calls focus() on an iframe within the main parent document, it will cause the window to bring itself directly to the front(or atleast cause the taskbar icon to s...

C# MDI Parent Gain Focus by clicking on MDI Parent background

I want to set focus to an MDI Parent Form when I click on the background of the form. However, the only way I can get it to set focus is when I resize the form. I have tried using mouse click event, click event, key press event etc to manually set the focus when you click on the MDI Parent but none of these events fire. Is there ANY wa...

Android: change style when focused

I have this custom layout: - LinearLayout - FrameLayout - ImageView - TextView This layout reacts to click events (using LinearLayout.setOnClickListener()) and is made focusable using android:focusable="true" in the layout XML file. This all works fine if you're using the touchscreen, but I'm thinking about users who d...

HTML: What determines the 'move the focus to the next control when Enter is hit' behavior

A basic HTML question. Is it possible on an HTML page to declaratively achieve a behavior when pressing Enter in a textbox moves the focus to the next control? How do you achieve it and how do you turn it off? Or maybe the dynamic javascript part should be involved here? For exaple, the following HTML in IE7 does not allow to move to th...

Is there a way to get a Telerik RadEditor to not show the toolbar by default when editor.set_html(value) is called in ShowOnFocus mode?

I'm trying to simulate keypresses and clicks in jQuery, which is working to blur the toolbar in IE6 but in Firefox it seems to remain open. Is there some way to blur the editor or some setting that I'm missing that makes it so that it doesn't steal focus and show the toolbar by default? Update it is showing up because I am calling edi...

Android: change TextView textColor when parent is focused

I have a TextView inside a LinearLayout. The LinearLayout is able to receive focus, and I want the textColor of the TextView to change when it does. I thought using a ColorStateList would work, but it would seem that the TextView does not receive focus when the LinearLayout does. I know that, because I have tried this code: mTextView.se...

Keep text selection when focus changes

I have a normal textbox, and a lightbox with a text input. I want to keep the user's selection in the textbox, even when the user focuses on the lightbox's text input. 1. Select text in normal textbox 2. Toggle lightbox 3. Focus on lightbox input At step 3., the user's text selection is discarded. How can this be prevented? See Googl...

Which HTML elements can receive focus?

I'm looking for a definitive list of HTML elements which are allowed to take focus, i.e. which elements will be put into focus when focus() is called on them? ...

Paragraph.BringIntoView() works only when focused

Hi, I am working on a text editor that is based on RichEditBox. I have implemented functionality "Go to line" which eventually resolves to TextPointer.Paragraph.BringIntoView(); Along with this I also set the caret position. What I found out is that BringIntoView only works when I click on the RichEditBox first (focus it). Otherwise it...

Set focus to jHtmlArea jQuery plugin

I'm using the jHtmlArea jQuery plugin on my page and I'm making it visible onClick of a button. Now I'm trying to place the focus into the jHtmlArea editor once it's displayed, but just can't seem to get there. I did find this blog post Setting Focus to Control in an IFRAME using jQuery which is talking about setting focus to an element...

Google Maps stealing focus when map is below the fold.

I have a website which is using Google Maps to display the location of a property. This map is located below the fold on the website. In IE8, Firefox, Safari etc this is working fine, but in IE7 (at the moment, specifically on Windows XP, can't really test on Vista/7 at the moment) the Maps seem to steal the focus and scrolls the page d...

How to programmatically set focus to HorizontalList so that it could receive key events (Flex)?

Hi, all. Please, look at the code: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:creationComplete> <![CDATA[ list.setFocus(); ]]> </mx:creationComplete> <mx:HorizontalList id="list"> <mx:creationComplete> <![CDATA[ setFocus(); ]]> </mx:creationCom...

Windows App Focus: Why does it require a click?

When I have 2 apps open and one has the focus but I want to execute a command in the other app, it requires a click to regain focus and another to execute the command. Is there some good reason why I couldn't take focus on MouseOver? I'm working with a WPF app if that is pertinent. TIA EDIT: Oddly enough the MouseOvers work without ...

Move focus in response to keyboard events in XAML

I've got a WPF view with two textboxes. I'd like to automatically move focus forward from the first textbox to the second when the user hits the down arrow on the keyboard exactly like Tab does. It seems like I ought to be able to do this 100% declaratively, but for some reason the commands I thought would do this don't seem to do anyt...

Why can't I use focus() to place a cursor inside of a text field outside of Firefox?

I'm using this line of code: $(":text:visible:enabled:first").focus(); It works in Firefox but not in Chrome, IE8, IE7, or Safari. I would ideally like to place the cursor in a text field at a form so that one may just starting typing in the field without having to navigate to it with a mouse. ...

jquery focus, but with more accurate postion.

you can easily find focus() answers from the site or any site.. but what i want to know, how can i use focus after what i just inserted inside the input box. $("input").val('@user').focus(); // this goes to start of the input box and foucs from start, but i want it to focus after the @user $("input").val('@user today i did new things')...

Is there any way to automatically focus an application started from kde autostart folder?

I'm currently starting Firefox on Kubuntu 9.0.4 from my .kde/Autostart directory. Firefox is starting fine, but it doesn't grab the focus in the KDE desktop. This is a problem because Firefox is set to start full-screen. As it does not grab focus, the KDE taskbar is still visible over the bottom of the Firefox screen. As soon as I select...

C# Mouse Right Click and Control Focus

I have a form which users can add controls to and when they right click it brings up a context menu which has an option to display the properties of the control they right clicked on. The problem I am having is trying to decide how to find out what control the user right clicks on since it could be any number of them and then giving tha...

Android EditText boxes

I want to cause the focus of one edit text box to move to another on editting (meaning you can only type on letter before it automatically moves on to the next edit text). It's the "on edit" that I can't get my head around. Can anyone help me out with a simple example? Theres a lot I need to implement it into, so just a basic understand...