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的更多相关文章

  1. Backbone Events 源码笔记

    用了backbone一段时间了,做一些笔记和总结,看的源码是1.12 backbone有events,model,collection,histoty,router,view这些模块,其中events ...

  2. 【原创】backbone1.1.0源码解析之Events

    最近在看些node的源代码,发现backbone的应用还是挺广泛的,但是之前的学习忘得一干二净了,后悔当时没做笔记啊. 所以,无奈想用的更好,就是得把源代码看楚,所以还是把源代码的注释笔记留下来,供自 ...

  3. 【SaltStack官方版】—— Events&Reactor系统—EVENT SYSTEM

    Events&Reactor系统 EVENT SYSTEM The Salt Event System is used to fire off events enabling third pa ...

  4. 【SaltStack官方版】—— EVENTS & REACTOR指南

    EVENTS & REACTOR Event System Event Bus Event types Salt Master Events Authentication events Sta ...

  5. Eloquent JavaScript #12# Handling Events

    索引 Notes onclick removeEventListener Event objects stopPropagation event.target Default actions Key ...

  6. Ionic2 rc2 Events 跨界面调用的使用方法及问题解决

    Events:事件注册  在任意一界面注册事件之后可在任意界面根据事件名称进行调用. 首先看一下官方文档的调用方式 import { Events } from 'ionic-angular'; co ...

  7. Ionic3,装饰器(@Input、@ViewChild)以及使用 Events 实现数据回调中的相关用法(五)

    标题栏的渐变效果 使用到的相关装饰器.Class以及相关方法:@Input.@ViewChild.Content.ionViewDidLoad ① @Input 装饰器:用来获取页面元素自定义属性值. ...

  8. [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 ...

  9. 【再探backbone 01】模型-Model

    前言 点保存时候不注意发出来了,有需要的朋友将就看吧,还在更新...... 几个月前学习了一下backbone,这段时间也用了下,感觉之前对backbone的学习很是基础,前几天有个园友问我如何将路由 ...

随机推荐

  1. redis 基本概览

    1 redis 支持5种数据类型.redis 的值是字节数组,所以他不关心具体存储的是什么. redis 的键可以是 数值 strings lists sets hashes Redis 支持诸如列表 ...

  2. datagrid,treegrid携带参数刷新示例

    datagrid携带参数刷新: var queryParams = $("#datagridId").datagrid("options").queryPara ...

  3. 基于EM的多直线拟合实现及思考

    作者:桂. 时间:2017-03-22  06:13:50 链接:http://www.cnblogs.com/xingshansi/p/6597796.html 声明:欢迎被转载,不过记得注明出处哦 ...

  4. Setting up a Passive FTP Server in Windows Azure VM(ReplyCode: 227, Entering Passive Mode )

    This post is authored by Lalitesh Kumar, Pradeep M G and reviewed by Avinash Venkat Reddy. Also spec ...

  5. CPD轮播广告库的简单算法

    在广告的领域中,有一种广告形式,采用的是CPD的售卖模式,为了对流量进行拆分,媒体方会对广告位进行轮播拆分.比如一个广告位,被拆成了10轮播,那么在广告主来预订广告位的时候,这个时候就可以告诉广告主, ...

  6. Spring事务管理实现方式之编程式事务与声明式事务详解(转)

    原文:https://blog.csdn.net/liaohaojian/article/details/70139151 编程式事务 编码方式实现事务管理(代码演示为JDBC事务管理) Spring ...

  7. μCOS-II系统之事件(event)的使用规则及Semaphore实例

    **************************************************************************************************** ...

  8. Xcode真机调试报错:The application could not be verified.

    今天真机调试的时候遇到这个错误: The application could not be verified. 这还是第一次遇到,应该是手机上的app的证书跟如今的证书不一致导致. 解决方法有两个 x ...

  9. mongoose中给字段添加索引的方法

    mongoose中给字段添加索引的方法有两种,一种通过在定义schema的时候配置,如: var animalSchema = new Schema({ name: String, type: Str ...

  10. static_cast、dynamic_cast、reinterpret_cast、和const_cast

    关于强制类型转换的问题,很多书都讨论过,写的最详细的是C++ 之父的<C++ 的设计和演化>.最好的解决方法就是不要使用C风格的强制类型转换,而是使用标准C++的类型转换符:static_ ...