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的学习很是基础,前几天有个园友问我如何将路由 ...
随机推荐
- Learning Django: the hard way (1)
Learning Django: the hard way (1) What does "runserver" do? Django provides a light-weight ...
- [k8s]prometheus+alertmanager二进制安装实现简单邮件告警
本次任务是用alertmanaer发一个报警邮件 本次环境采用二进制普罗组件 本次准备监控一个节点的内存,当使用率大于2%时候(测试),发邮件报警. k8s集群使用普罗官方文档 环境准备 下载二进制h ...
- mysql 的S 锁和X锁的区别
共享锁和排它锁 MySQL的锁系统:shared lock和exclusive lock(共享锁和排他锁,也叫读锁和写锁,即read lock和write lock) 读锁是共享的,或者说是相互不阻塞 ...
- 学习笔记之gethostbyaddr函数
刚才学了gethostbyname函数,这个gethostbyaddr函数的作用是通过一个IPv4的地址来获取主机信息,并放在hostent结构体中. #include <netdb.h> ...
- C++ new操作符详解
一.new操作符的概念 我们通常讲的new是指的是new operator,其实还有另外两个概念,operator new 和 placement new. 1.new operator 我们在使用n ...
- 回调形成树形结构tree
//Tree.vue <template> <li> <span @click="toggle"> <i v-if="isFol ...
- PeekMessage、GetMessage的区别
在Windows编程中经常使用这两个函数来处理消息,它们之间的区别就是GetMessage是阻塞的,PeekMessage是非阻塞的. GetMessage原型如下:BOOL GetMessage(L ...
- Centos7 squid安装与配置
装squid yum install -y squid 安装httpd(用于后面生成密码文件) yum install -y httpd 或者 yum install httpd-tools -y 配 ...
- org.apache.commons
Apache Commons包含了很多开源的工具,用于解决平时编程经常会遇到的问题,减少重复劳动.我选了一些比较常用的项目做简单介绍. 一.Commons BeanUtils http://jakar ...
- linux使用记录(一)
1.tar #解压tar –xvf file.tar #解压 tar包 tar -xzvf file.tar.gz #解压tar.gz tar -xjvf file.tar.bz2 #解压 tar.b ...