keyboardinterpreter_fr.java

来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 64 行

JAVA
64
字号
/*
 * $Id: KeyboardInterpreter_FR.java,v 1.7 2004/02/15 11:07:44 epr Exp $
 */

package org.jnode.driver.input.l10n;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

import org.jnode.driver.input.DeadKeyException;
import org.jnode.driver.input.KeyboardInterpreter;
import org.jnode.driver.input.UnsupportedKeyException;


/**
 * KeyboardInterpreter_FR.java
 *
 * @author Created by Marc DENTY on Feb 01 2004
 * @since 0.15
 */
public class KeyboardInterpreter_FR extends KeyboardInterpreter {
	protected int lastDeadVK = -1;
	protected int lastFlags = -1;
	
	public KeyboardInterpreter_FR() {
		super();
		
	}
	
	/**
	 * Method interpretExtendedScanCode this method sould be used to handle the dead keys and other special keys
	 *
	 * @param    scancode            an int
	 * @param    vk                  an int
	 * @param    released            a  boolean
	 *
	 * @return   the char to use or throws an Exception
	 * @exception   UnsupportedKeyException is thrown if the current key is not handled by this method
	 * @exception   DeadKeyException is thrown if the current key is a dead key
	 *
	 * @author 	Marc DENTY
	 * @version  2/8/2004
	 * @since 0.15
	 */
	protected char interpretExtendedScanCode(int scancode, int vk, boolean released) throws UnsupportedKeyException, DeadKeyException {
		boolean deadKey = false;
//		System.err.print("vk = "+vk);
		switch(vk) {
			case KeyEvent.VK_DEAD_CIRCUMFLEX:
				lastDeadVK = KeyEvent.VK_DEAD_CIRCUMFLEX;
				lastFlags = flags;
				deadKey = true;
				break;
		}
		if(deadKey) {
//			System.err.println("Dead key pressed : vk="+vk+", flags="+flags);
			throw new DeadKeyException();
		} else {
			try {
				switch(lcharMap[scancode]) {
					case 'a':
						switch(lastDeadVK) {
							case KeyEvent.VK_DEAD_CIRCUMFLEX:
								if(lastFlags == InputEvent.SHIFT_DOWN_MASK) {
									return '

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?