onkeydown

Android: How to control the home button

三世轮回 提交于 2019-11-30 22:04:43
We're trying to provide an application to the mentally and physically handicapped daughter of my neighbor that let's her use an Android tablet as a Talker, i.e., she presses a few big buttons and the devices generates speech. The application is basically a WebView and an additional object in Javascript used to perform and control the speech generation, plus some logic to handle the orientation changes. Html files are generated offline for her specific layout of the talking items. We've also added some music playing and picture viewing facilities to make the device more appealing to her.

onKeyDown() issue

Deadly 提交于 2019-11-30 11:43:36
I would like to create a photo/video capture application. I have created a CaptureView class which extends SurfaceView and placed it in the main form. The main form's activity has onCreateOptionsMenu() method which creates a menu. The menu worked fine but then I tried to implement a method onKeyDown : @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN) { switch(keyCode) { case KeyEvent.KEYCODE_CAMERA: videoPreview.TakePicture(); return true; } } return super.onKeyDown(keyCode, event); } The menu doesn't appear anymore and the method

onKeyDown() issue

丶灬走出姿态 提交于 2019-11-29 17:25:28
问题 I would like to create a photo/video capture application. I have created a CaptureView class which extends SurfaceView and placed it in the main form. The main form's activity has onCreateOptionsMenu() method which creates a menu. The menu worked fine but then I tried to implement a method onKeyDown : @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN) { switch(keyCode) { case KeyEvent.KEYCODE_CAMERA: videoPreview.TakePicture();

AutoCompleteTextView detect when selected entry from list edited by user

最后都变了- 提交于 2019-11-29 17:03:00
问题 I have an AutoCompleteTextView I use to select an item from a long list. The user should only be able to select a predetermined item from the list. They should not be able to enter their own item. The way I check to make sure they submit only an item from the list is to use setOnItemClickListener to trigger a boolean flag. The problem is that after the boolean flag is set to true, they can still edit the selected text of the item. I need to detect this and set the boolean flag to false again.

override existing onkeydown function

情到浓时终转凉″ 提交于 2019-11-29 15:28:12
My extensions go through every input entered on an on any website that is loaded. What I do is I consider every onkeydown and manipulate it if it has some value. my background js file contains the following: document.onkeydown = returnKey; function returnKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ( node.value == 'fi' ) { evt.srcElement.value = "??"; } } My problem is when I have websites that already contains onkeydown function in their innerHTML webpage. for instance: taken from facebook's

override existing onkeydown function

爱⌒轻易说出口 提交于 2019-11-28 08:39:42
问题 My extensions go through every input entered on an on any website that is loaded. What I do is I consider every onkeydown and manipulate it if it has some value. my background js file contains the following: document.onkeydown = returnKey; function returnKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ( node.value == 'fi' ) { evt.srcElement.value = "??"; } } My problem is when I have websites

How to disable facebook hotkeys with Chrome extension?

試著忘記壹切 提交于 2019-11-28 06:38:52
I have created a Chrome extension that uses the hotkeys [Alt]+[0...9] only to discover facebook uses the same hotkeys. Is there any way possible my extension could disable facebook's hotkeys so that mine fire alone? I'm fairly certain I have identified the code facebook uses to implement their [Alt]+[0...9] hotkeys: document.documentElement.onkeydown=function(a){a=a||window.event;var b=a.target||a.srcElement;var c=a.keyCode==13&&!a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&CSS.hasClass... This is in a script called from the head of the root document. I have tried the following to disable

WPF: OnKeyDown() not being called for space key in control derived from WPF TextBox

旧城冷巷雨未停 提交于 2019-11-28 00:43:52
In a WPF application, I have a control that I have derived from TextBox like this: public class SelectableTextBlock : TextBox { protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); e.Handled = false; } } The OnKeyDown method is not called when entering a space into the TextBox, nor when hitting Backspace, but does fire for other input including normal printable characters (e.g. 'a') and modifier keys (e.g. ). I'm using this control with IsReadOnly set to true so I can display selectable, uneditable text. The control used within WPFToolkit's DataGrid, and I want KeyDown events

Upgraded to AppCompat v22.1.0 and now onKeyDown and onKeyUp are not triggered when menu key is pressed

一笑奈何 提交于 2019-11-27 20:39:33
I've just upgraded my app to use the newly released v22.1.0 AppCompat and now onKeyDown and onKeyUp are not triggered when menu key is pressed. The other keys correctly trigger onKeyDown and onKeyUp , but when i press the menu key nothing happens. If I downgrade to v22.0.0 everything returns to work properly. How do I fix it? Update 23 August This has been fixed again in the v23.0.0 of appcompat-v7 support library. Update to the last version to see this fixed. Update 19 July Unfortunately AppCompat v22.2.1 broke the onKeyDown and onKeyUp events again . I just updated

How to capture a backspace on the onkeydown event

霸气de小男生 提交于 2019-11-27 11:45:35
I have a function that is triggered by the onkeydown event of a textbox. How can I tell if the user has hit either the backspace key or the del key? Stephano Try this: document.addEventListener("keydown", KeyCheck); //or however you are calling your method function KeyCheck(event) { var KeyID = event.keyCode; switch(KeyID) { case 8: alert("backspace"); break; case 46: alert("delete"); break; default: break; } } Nowadays, code to do this should look something like: document.getElementById('foo').addEventListener('keydown', function (event) { if (event.keyCode == 8) { console.log('BACKSPACE was