jQuery: keyup for TAB-key?

My hunch is that when you press the tab key, your form’s input loses focus, before the keyup happens. Try changing the binding to the body, like this: $(‘body’).keyup(function(e) { console.log(‘keyup called’); var code = e.keyCode || e.which; if (code == ‘9’) { alert(‘Tab pressed’); } }); Then, if that works (it does for me) … Read more

How to get a list of open tabs from chrome? | C#

First Reference two dll UIAutomationClient.dll UIAutomationTypes.dll Located: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 (or 3.5) Then using System.Windows.Automation; and the code Process[] procsChrome = Process.GetProcessesByName(“chrome”); if (procsChrome.Length <= 0) { Console.WriteLine(“Chrome is not running”); } else { foreach (Process proc in procsChrome) { // the chrome process must have a window if (proc.MainWindowHandle == IntPtr.Zero) { continue; … Read more

How to change tab style in Android?

You could adjust the tabs via code – here’s an excerpt from my application, but you could also assign themes instead of the background image directly. (I haven’t used a way via xml attributes yet, not sure if that’s available as well somehow). private void initTabs() { tabs = (TabHost) findViewById(R.id.tabhost); tabs.setup(); tabs.setBackgroundResource(R.drawable.bg_midgray); TabHost.TabSpec spec; … Read more

Retrieving which tabs are open in Chrome?

Yes, here is how you can do this: Note: this requires permission “tabs” to be specified in your manifest file. chrome.windows.getAll({populate:true}, getAllOpenWindows); function getAllOpenWindows(winData) { var tabs = []; for (var i in winData) { if (winData[i].focused === true) { var winTabs = winData[i].tabs; var totTabs = winTabs.length; for (var j=0; j<totTabs;j++) { tabs.push(winTabs[j].url); } … Read more

Is there any way to detect that window is currently active in IE8?

I’ve written a jQuery plugin that does this: http://mths.be/visibility It gives you a very simple API that allows you to execute callbacks when the page’s visibility state changes. It does so by using the the Page Visibility API where it’s supported, and falling back to good old focus and blur in older browsers. Demo: http://mathiasbynens.be/demo/jquery-visibility … Read more

How to use camera flash/led as torch on a Samsung Galaxy Tab?

You aren’t doing anything wrong. In fact, you are doing everything correct. You are encountering a Device-Specific issue that is very prevalent in the Android world. I have found the following behavioral patterns for FLASH_MODE_TORCH: Works fine in all cases Works fine, but not with autofocus on Doesn’t work at all Frustratingly, getSupportedFlashModes() will return … Read more

How do I implement swiping between tabs on Android?

NOTE: This is an excerpt from the Android Training class Implementing Effective Navigation. To implement this (in Android 3.0 or above), you can use a ViewPager in conjunction with the ActionBar tabs API. Upon observing the current page changing, select the corresponding tab. You can set up this behavior using an ViewPager.OnPageChangeListener in your activity’s … Read more