当前位置: 首页>>代码示例>>Java>>正文


Java KeyEvent.getCode方法代码示例

本文整理汇总了Java中javafx.scene.input.KeyEvent.getCode方法的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.getCode方法的具体用法?Java KeyEvent.getCode怎么用?Java KeyEvent.getCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.input.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.getCode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: txtNomeSoftware_onKeyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@FXML
void txtNomeSoftware_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.ENTER) {
		if (txtNomeSoftware.getText().equals("")) {
			preencherTableViewRequisitos(software.buscarTodosSoftwares());
		} else {
			preencherTableViewRequisitos(software.buscarPorNome(txtNomeSoftware.getText()));
		}
	}
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:11,代码来源:FrmSolicitarReservaHorarioPorRequisito.java

示例2: onKeyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
private void onKeyPressed(KeyEvent event) {
    if (event.getCode() == KeyCode.ESCAPE) {
        handleSelection(Selection.CANCEL);
    } else if (event.getCode() == KeyCode.ENTER) {
        Node focusOwner = root.getScene().getFocusOwner();
        if (focusOwner instanceof Button) {
            ((Button) (focusOwner)).fire();
        }
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:11,代码来源:SaveDialogComponent.java

示例3: updateVector

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
/**
 * Update the vector.
 *
 * @param event the event
 */
@FXThread
protected void updateVector(@Nullable final KeyEvent event) {
    if (isIgnoreListener() || (event != null && event.getCode() != KeyCode.ENTER)) return;

    final FloatTextField xField = getXField();
    final float x = xField.getValue();

    final FloatTextField yFiled = getYFiled();
    final float y = yFiled.getValue();

    final FloatTextField zField = getZField();
    final float z = zField.getValue();

    final Vector3f oldValue = getPropertyValue() == null ? Vector3f.ZERO : getPropertyValue();
    final Vector3f newValue = new Vector3f();
    newValue.set(x, y, z);

    changed(newValue, oldValue.clone());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:25,代码来源:Vector3FPropertyControl.java

示例4: updateRotation

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
/**
 * Updating rotation.
 */
@FXThread
private void updateRotation(@Nullable final KeyEvent event) {
    if (isIgnoreListener() || (event != null && event.getCode() != KeyCode.ENTER)) return;

    final Quaternion oldValue = notNull(getPropertyValue());

    final FloatTextField xField = getXField();
    final float x = degreeToRadians(xField.getValue());

    final FloatTextField yFiled = getYFiled();
    final float y = degreeToRadians(yFiled.getValue());

    final FloatTextField zField = getZField();
    final float z = degreeToRadians(zField.getValue());

    final Quaternion newValue = new Quaternion();
    newValue.fromAngles(ArrayFactory.toFloatArray(x, y, z));

    changed(newValue, oldValue.clone());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:24,代码来源:QuaternionPropertyControl.java

示例5: onKeyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
protected void onKeyPressed(KeyEvent e) {
    if (e.getCode() == KeyCode.CONTROL || e.getCode() == KeyCode.SHIFT || e.getCode() == KeyCode.ALT
            || e.getCode() == KeyCode.META) {
        return;
    }
    String keyText = OSFXUtils.isModifiers(e) ? OSFXUtils.ketEventGetModifiersExText(e) + "+" : "";
    keyText += OSFXUtils.keyEventGetKeyText(e.getCode());
    keyTriggerField.setText(keyText);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:10,代码来源:PreferencesStage.java

示例6: recordRawKeyEvent

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@Override public void recordRawKeyEvent(RFXComponent r, KeyEvent e) {
    JSONObject event = new JSONObject();
    event.put("type", "key_raw");
    KeyCode keyCode = e.getCode();
    if (keyCode.isModifierKey()) {
        return;
    }
    if ((keyCode.isFunctionKey() || keyCode.isArrowKey() || keyCode.isKeypadKey() || keyCode.isMediaKey()
            || keyCode.isNavigationKey() || e.isControlDown() || e.isMetaDown() || e.isAltDown()
            || needManualRecording(keyCode)) && e.getEventType() == KeyEvent.KEY_PRESSED) {
        String mtext = buildModifiersText(e);
        event.put("modifiersEx", mtext);
        KeysMap keysMap = KeysMap.findMap(e.getCode());
        if (keysMap == KeysMap.NULL) {
            return;
        }
        String keyText;
        if (keysMap == null) {
            keyText = e.getText();
        } else {
            keyText = keysMap.toString();
        }
        event.put("keyCode", keyText);
    } else if (e.getEventType() == KeyEvent.KEY_TYPED && !e.isControlDown() && !needManualRecording(keyCode)) {
        char[] cs = e.getCharacter().toCharArray();
        if (cs.length == 0) {
            return;
        }
        for (char c : cs) {
            if (Character.isISOControl(c) && hasMapping(c)) {
                event.put("keyChar", getMapping(c));
            } else {
                event.put("keyChar", "" + c);
            }
        }
    } else {
        return;
    }
    recordEvent(r, event);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:41,代码来源:WSRecorder.java

示例7: onKeyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
private void onKeyPressed(KeyEvent event) {
    if (event.isShortcutDown() && event.getCode() == KeyCode.Z) {
        eventBus.post(MenuActionEvent.UNDO);
        event.consume();
    } else if (event.isShortcutDown() && event.getCode() == KeyCode.Y) {
        eventBus.post(MenuActionEvent.REDO);
        event.consume();
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:10,代码来源:PropertyEditorPresenter.java

示例8: processKey

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@Override
@FXThread
protected void processKey(@NotNull final KeyEvent event) {
    if (event.getCode() == KeyCode.ENTER) {
        processClose();
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:8,代码来源:ConfirmDialog.java

示例9: keyTyped

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@FXML
protected void keyTyped(KeyEvent event) {
    charCount.setText(Integer.toString(msgText.getText().length()));
    if (event.getCode() == KeyCode.TAB) {
        btnSend.requestFocus();
        event.consume();
    }
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:9,代码来源:SendMessageDialogController.java

示例10: deleteEntries

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
private void deleteEntries(KeyEvent evt) {
    switch (evt.getCode()) {
        case DELETE:
        case BACK_SPACE:
            for (Entry<?> entry : dateControl.getSelections()) {
                if (!dateControl.getEntryEditPolicy().call(new DateControl.EntryEditParameter(dateControl, entry, DateControl.EditOperation.DELETE))) {
                    continue;
                }
                if (entry.isRecurrence()) {
                    entry = entry.getRecurrenceSourceEntry();
                }
                if (!dateControl.getEntryEditPolicy().call(new DateControl.EntryEditParameter(dateControl, entry, DateControl.EditOperation.DELETE))) {
                    continue;
                }

                Calendar calendar = entry.getCalendar();
                if (calendar != null && !calendar.isReadOnly()) {
                    entry.removeFromCalendar();
                }
            }
            dateControl.clearSelection();
            break;
        case F5:
            dateControl.refreshData();
        default:
            break;
    }
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:29,代码来源:CreateDeleteHandler.java

示例11: handle

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@Override
public void handle(KeyEvent event) {
    switch (event.getCode()) {
        case UP:
            increment();
            break;
        case DOWN:
            decrement();
            break;
        default:
            break;
    }
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:14,代码来源:TimeFieldSkin.java

示例12: tblPedidos_onKeyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@FXML
void tblPedidos_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.ENTER) {
		if (tblPedidos.getSelectionModel().getSelectedItem() != null) {
			preencherVisualizarDados(tblPedidos.getSelectionModel().getSelectedItem());
			tbpDados.getSelectionModel().select(tabDados);
		}
	}
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:10,代码来源:FrmPedidosReserva.java

示例13: ckbFixo_onKeyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@FXML
void ckbFixo_onKeyPressed(KeyEvent event) {
	if (event.getCode() == KeyCode.TAB)
		btnConfirmar.requestFocus();
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:6,代码来源:FrmSolicitarReservaHorarioPorRequisito.java

示例14: btnExcluir_onKeyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@FXML
void btnExcluir_onKeyPressed(KeyEvent event) {
    if (event.getCode() == KeyCode.ENTER) {
        btnExcluir.fire();
    }
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:7,代码来源:FrmCadastroDepartamento.java

示例15: keyPressed

import javafx.scene.input.KeyEvent; //导入方法依赖的package包/类
@Override protected void keyPressed(KeyEvent ke) {
    if (ke.getCode() == KeyCode.SPACE) {
        recorder.recordRawKeyEvent(this, ke);
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:6,代码来源:RFXCheckBox.java


注:本文中的javafx.scene.input.KeyEvent.getCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。