keyboard

Background glitch on keyboard closure

核能气质少年 提交于 2019-12-23 23:06:53
问题 I'm facing a situation with a little complex fragment layout xml of mine, So the hierarchy follows as: RelativeLayout (no background) --ScrollView (fillViewPort=true, scrollbars=none) ----FrameLayout (no background) ------LinearLayout (no background) --------RelativeLayout (background color of gray) ----------EditText ... So when the edittext clicked it opens soft keyboard (as expected), and when back press or some click block which hides keyboard with following method: try {

Use an EditText with custom keyboard

五迷三道 提交于 2019-12-23 20:50:09
问题 I am new to android. I am trying to create an application with a custom keyboard, used for the application only. Not a general keyboard for distribution. Basically my test is to have a layout like: Relative Layout Relative Layout id tolayouot EditText id userID Button LinearLayout alignbottomparent=TRUE InputMethodService.KeyboardView id kv So there is a top section with an Edit Box and a button and the bottom section is the keyboard. When I press the button, the Custom Keyboard appears. Then

ipad how to know keyboard has been hidden

孤者浪人 提交于 2019-12-23 19:58:25
问题 Im building an ipad app, it haves some text fields that when tapped, move above the keyboard, if a "calculate" button is tapped, keyboard and view, go down, but if the user taps on the hide keyboard from the ipad [bottom right corner key of keyboard] my view remains moved high, so, how can i know programatically that the "hide keyboard" has been tapped? thanks a lot! 回答1: You should use the notification center for tracking the keyboard, NSNotificationCenter *center = [NSNotificationCenter

How to detect if the delete key was pressed in Actionscript 3?

强颜欢笑 提交于 2019-12-23 19:20:21
问题 How do I determine if the delete key was pressed using actionscript? addEventListener(KeyboardEvent.KEY_UP, onKeyUp); ... function onKeyUp(event:KeyboardEvent):void { trace(event.keyCode); } The above code yields no value when delete, backspace, enter, and other command keys are pressed. However, arrow keys do yield values. 回答1: this.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed); .... function onKeyPressed(event:KeyboardEvent):void { if (event.keyCode==Keyboard.DELETE) { .....

Ensure statement is executed only once when a key is pressed and held.

浪子不回头ぞ 提交于 2019-12-23 17:25:21
问题 If you press and hold the 5 key on the numpad it will continue to execute a statement in the KeyDown event handler. How can i ensure the statement is executed only once, even if i hold the key down? Thanks for your attention. private void form_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.NumPad5) { dados.enviar("f"); //I want this to run only once! } } 回答1: You can set flag on key down and reset it on key up. private bool isPressed = false; public Form1(

How to detect `delete` and `.` when user press the keyboard on Chrome?

一曲冷凌霜 提交于 2019-12-23 17:16:11
问题 When I press . it fires the three events, keydown , keypress and keyup . keydown which: 190 == ¾ keyCode: 190 == ¾ keypress which: 46 == . keyCode: 46 == . keyup which: 190 == ¾ keyCode: 190 == ¾ When I press delete it fires two events, keydown and keyup . keydown which: 46 == . keyCode: 46 == . keyup which: 46 == . keyCode: 46 == . I want to press . and be able to get the corresponding character ( 46 == . ). But on keydown and keyup I get 190 which is ¾ . On the keypress I get the correct

keyboard hook in windows C++ or what?

烈酒焚心 提交于 2019-12-23 17:00:45
问题 I wish to build my own application which can send keyboard commands(messages) to the Windows OS. For example when I press the combination ctrl+shift+n, I wish to launch the notepad.exe . How can I do that? Do you have some advice for me about the concept used. I've read that is possible when are used keyboard hooks? That's the only way? Do you know a free and open-source application which does this as simple is possible? 回答1: Your particular example can be done without any programming at all,

WPF ListView Keyboard Navigation Problem

徘徊边缘 提交于 2019-12-23 16:50:36
问题 I've a listview like this ListView: ————----- Mango Orange Grapes Grapes Grapes Apple Strawberry Whenever i navigate using downarrow, the BlueHighlight pauses at the first Grapes, a dotted rectangle start from second grapes and pauses at the third grapes, then the BlueHighlight resumes from Apple. This seems weird and it grows more weird when the navigation is upwards. It jumps from Apple to Orange or mango. Is this due to Virtualization? It seems only the duplicate data (grapes) is creating

Can I access stdin without keyboard?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 15:48:15
问题 I have compiled the following code with gcc int main() { int a = 0; fprintf( stdin, "%d", 123 ); fscanf( stdin, "%d", &a ); printf( "%d\n", a ); return 0; } In my expectation, the program should executes straightly (i.e., the program never pause and wait for user input). But it still stop, and wait for my input. I want to know what happen when I try to write something to stdin and how to modify this code and it can execute straightly? 回答1: stdin is for input only, stdout is for output.

Cocoa app respond to keyboard play/pause key without launching iTunes?

戏子无情 提交于 2019-12-23 15:39:14
问题 I read this article and successfully make my app respond to media key: Make my Cocoa app respond to the keyboard play/pause key? However, when I pressed play/pause key, the iTunes started to launch, is there any method to prevent iTunes launching when I press play/pause key in my app? 回答1: Your best bet is to use this SPMediaKeyTap code, it works OK, but it can be flaky since your app's bundle ID isn't included in other's code, and the developer is not responsive to requests for new bundle