onkeydown

OnKeydown for “-” does not get fired in Delphi 7 application

被刻印的时光 ゝ 提交于 2019-12-20 06:32:56
问题 We are using Delphi 7 enterprise edition, application is build on windows XP, testing on both Windows XP and Windows 7. In an application we maintain, something strange is happening. For some reason hitting the "-" key (qwerty layout, between "0" and "=" keys on top) does not register at all. We checked in the OnKeyDown of the edit we found it with, the OnKeyDown of the form (with and without key preview) and even the ProcessMessage routine, but the event for this key never reaches the

Capturing onkeydown in Javascript

狂风中的少年 提交于 2019-12-19 04:44:13
问题 I have a web front-end to an AS/400 CGI application which allows the use of some of the F1 - F24 keys (depending on the page) as well as page-up, page-down etc - these are passed to the underlying application which handles them appropriately. For instance, on a given page, a user could either press the F3 button or press the F3 key - both of them will set the (hidden) CmdKey variable to have a name of '_K03' and a value of 'F03'. The button handling is simple and has no problems. To handle

Android: How to control the home button

久未见 提交于 2019-12-19 03:45: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

Android: How to control the home button

人走茶凉 提交于 2019-12-19 03:45:23
问题 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

Why keydown listener doesn't work in IE

可紊 提交于 2019-12-17 21:06:27
问题 Im trying to run this in IE 8 but it doesn't work, any idea? It works in Firefox, Chrome, Opera... preventBackspace(); function preventBackspace() { try { if (window.addEventListener) { window.addEventListener("keydown", onKeyDown, true); } else if (window.attachEvent) { // IE alert(window); window.attachEvent("onkeydown", onKeyDown); } else { document.addEventListener("keydown", onKeyDown, true); } } catch (e) { alert(e); } } function onKeyDown(e) { alert("test!"); } jsfiddle: http:/

Fragment activity catch onKeyDown and use in fragment

孤街醉人 提交于 2019-12-17 18:34:21
问题 I have Fragment activity with pager: List<Fragment> fragments = new Vector<Fragment>(); fragments.add(Fragment.instantiate(this, PastEventListFragment.class.getName(),bundle)); fragments.add(Fragment.instantiate(this, EventListFragment.class.getName(),bundle)); this.mPagerAdapter = new EventPagerAdapter(super.getSupportFragmentManager(), fragments); // ViewPager pager = (ViewPager)super.findViewById(R.id.viewpager1); pager.setAdapter(this.mPagerAdapter); pager.setCurrentItem(1); I catch

onKeyDown in a service? (Global Hot Keys)

蓝咒 提交于 2019-12-17 09:36:07
问题 What I'm basically trying to achieve is custom global hot keys or in other words 'things will happen when I push certain buttons no matter which program is currently on top'. I assume a service is needed. I have a quick and dirty test that just tells me what has been pressed that will work if it is the active window. public boolean onKeyDown(int keyCode, KeyEvent event) { char pop; pop = (char)event.getUnicodeChar(); Toast.makeText(this, Character.toString(pop) , Toast.LENGTH_SHORT).show();

What is the equivalent for onkeydown and onkeyup (Javascript events) in python?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 08:48:33
问题 There are events called 'onkeydown' and 'onkeyup' in Javascript. Can anyone please suggest the python equivalent of it? 回答1: Without any external library, python can't provide GUI features, such as events handling. Listening to an event such onkeydown or onkeyup is thus impossible with the python sdl. If you really want to react to these events, you must use an external library providing event-driven operations, such as the Qt binding PyQt, the TKinter module, or other libraries. 来源: https:/

Where to put code for a global hardware key listener?

让人想犯罪 __ 提交于 2019-12-13 06:36:41
问题 I'm trying to hack hardware key support into an existing app, but came to realize I know too little of Android app development to continue. I can decompile and recompile the app without problems using APKtool, and I made a small app myself with hardware key support to pull the compiled smali code out of. For reference, that part looks like this: .method public onKeyDown(ILandroid/view/KeyEvent;)Z If I want to have the app listen for hardware keys "globally" (i.e. in every activity, window,

why are onkeyup events not firing in javascript game

时间秒杀一切 提交于 2019-12-12 13:36:16
问题 I have the beginnings of a 2d javascript game - at the moment the player can drive a triangle around the screen using the arrow keys. The problem is that sometimes the triangle will get stuck rotating in one direction or moving forward until the corresponding control key is pressed again and the onkeyup event is fired again. This usually happens when more than one control key is pressed at the same time. I can't work out why it's getting stuck in the first place unless the onkeyup events aren