e636. Listening to All Key Events Before Delivery to Focused Component
Registering a key event dispatcher with the keyboard focus manager allows you to see all key events before they are sent to the focused component. It is possible to modify the event or even prevent the event from being delivered.
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(
new KeyEventDispatcher() {
public boolean dispatchKeyEvent(KeyEvent e) {
// This example converts all typed keys to upper case
if (e.getID() == KeyEvent.KEY_TYPED) {
e.setKeyChar(Character.toUpperCase(e.getKeyChar()));
} // If the key should not be dispatched to the
// focused component, set discardEvent to true
boolean discardEvent = false;
return discardEvent;
}
});
| Related Examples |
e636. Listening to All Key Events Before Delivery to Focused Component的更多相关文章
- Backbone Events 源码笔记
用了backbone一段时间了,做一些笔记和总结,看的源码是1.12 backbone有events,model,collection,histoty,router,view这些模块,其中events ...
- 【原创】backbone1.1.0源码解析之Events
最近在看些node的源代码,发现backbone的应用还是挺广泛的,但是之前的学习忘得一干二净了,后悔当时没做笔记啊. 所以,无奈想用的更好,就是得把源代码看楚,所以还是把源代码的注释笔记留下来,供自 ...
- 【SaltStack官方版】—— Events&Reactor系统—EVENT SYSTEM
Events&Reactor系统 EVENT SYSTEM The Salt Event System is used to fire off events enabling third pa ...
- 【SaltStack官方版】—— EVENTS & REACTOR指南
EVENTS & REACTOR Event System Event Bus Event types Salt Master Events Authentication events Sta ...
- Eloquent JavaScript #12# Handling Events
索引 Notes onclick removeEventListener Event objects stopPropagation event.target Default actions Key ...
- Ionic2 rc2 Events 跨界面调用的使用方法及问题解决
Events:事件注册 在任意一界面注册事件之后可在任意界面根据事件名称进行调用. 首先看一下官方文档的调用方式 import { Events } from 'ionic-angular'; co ...
- Ionic3,装饰器(@Input、@ViewChild)以及使用 Events 实现数据回调中的相关用法(五)
标题栏的渐变效果 使用到的相关装饰器.Class以及相关方法:@Input.@ViewChild.Content.ionViewDidLoad ① @Input 装饰器:用来获取页面元素自定义属性值. ...
- [React] Normalize Events with Reacts Synthetic Event System
Event handlers are passed an instance of SyntheticEvent in React. In this video we'll take a look at ...
- 【再探backbone 01】模型-Model
前言 点保存时候不注意发出来了,有需要的朋友将就看吧,还在更新...... 几个月前学习了一下backbone,这段时间也用了下,感觉之前对backbone的学习很是基础,前几天有个园友问我如何将路由 ...
随机推荐
- Python lower() 方法
描述 Python lower() 方法转换字符串中所有大写字符为小写,其效果和 casefold() 方法非常相似. 两者的区别是:lower() 方法只对ASCII编码,也就是‘A-Z’有效,对于 ...
- django1.8中如何显示图片,应用css样式,javascript事件
在django中将图片.javascript.css称为静态文件.如何将这些静态文件显示在django中呢?近期做一个项目,一直困扰着我,后来查找各种资源,终于在官方文档中找到. 官方文档链接 在se ...
- Angularjs Module类的介绍及模块化依赖
后面的学习我们会遵循一个控制器管理一个视图,一个路由对应一个视图的单一原则,所以再不会将controller控制器代码直接写到 index.html 中. 我们会应用到angular.js中强大的模块 ...
- Android中的httpclient框架发送get请求
/** * 採用httpclientGet请求的方式 * * @param username * @param password * @return null表示求得的路径有问题,text返回请求得到 ...
- BZOJ 1029 JSOI2007 建筑抢修 贪心+堆
题目大意:n个建筑须要抢修.第i个建筑须要T1时间抢修.必须在T2时间之前抢修完成.求最多能抢修多少建筑 首先我们对T2排序 然后依次修理 可是这样贪心显然是不对的 比方说这组数据: 5 10 10 ...
- 【Android】3.23 示例23--瓦片图功能
分类:C#.Android.VS2015.百度地图应用: 创建日期:2016-02-04 一.简介 地图SDK自v3.6.0起,新增瓦片图层(tileOverlay), 该图层支持开发者添加自有瓦片数 ...
- 【转】32位和64位系统区别及int字节数
http://blog.csdn.net/zhongzhiwei/article/details/8678885 一)64位系统和32位有什么区别? 1.64bit CPU拥有更大的寻址能力,最大支持 ...
- Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE 解决方法
最近在做真机测试的时候,经常出现Installation error: INSTAL L_FAILED_INSUFFICIENT_STORAGE这个问题,导致apk没法安装到是手机上,在eclipse ...
- 每日英语:A New Recipe for Innovation That Feeds the Whole Organization
The world is a fast and dangerous place. To survive a company must innovate. Many organizations look ...
- PowerShell实现基于SharePoint的网站HomePage Auto-Create Solution
*** HomePage Auto-Create Solution Monday, January 12, 2015 PS:该项目为公司项目,我还是给他的名字屏蔽掉吧,这是我用PowerShell ...