Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alt keypresses on a mac #2

Open
crofty opened this issue Nov 23, 2019 · 1 comment
Open

Alt keypresses on a mac #2

crofty opened this issue Nov 23, 2019 · 1 comment

Comments

@crofty
Copy link

crofty commented Nov 23, 2019

Hello 👋
I'm super interested to try this out. I'm on a mac and I don't seem to be able to use some of the functions - i think the default keymap doesn't work well on a mac.

For example. I'm trying to cycle the functions with next-candidate which should be invoked with ALT-n. However, if I press option-n it's getting interpreted as option ~ and so the next-candidate function bound to ALT-n isn't firing.

This is what is displayed at the bottom when I press Option n:
Monosnap 2019-11-23 15-34-10

I don't know how to actually trigger an ALT-n on a mac. Whenever the Option key is pressed down the character that is bound to the n key changes. This can be seen with the onscreen keyboard viewer:

British 2019-11-23 15-43-48

And so, if the option key is pressed, any press of n is going to be interpreted as a ~.

I can change the key_table.clj so that it looks for a ~ instead of a n, but I thought i'd raise the issue here in case there's another option.

1  vim 2019-11-23 15-45-27

@illiichi
Copy link
Owner

illiichi commented Nov 28, 2019

Thank you for your interest!

A code to interpret JavaFX event is at view/controller/keyboard_input.clj.
I think code field of javafx.scene.input.KeyEvent should be used. But the value is UNDEFINED on my environment, which is on linux.

Class: javafx.scene.input.KeyEvent
Value: "#object[javafx.scene.input.KeyEvent 0x7e626301 \"KeyEvent [source = javafx.scene.Scene@13a2bbd8, target = javafx.scene.Scene@13a2bbd8, eventType = ...
---
Fields:
  "altDown" = true
  "character" = "n"
  "code" = UNDEFINED
  "consumed" = false
  "controlDown" = false
  "eventType" = KEY_TYPED
  "metaDown" = false
  "shiftDown" = false
  "source" = javafx.scene.Scene@13a2bbd8
  "target" = javafx.scene.Scene@13a2bbd8
  "text" = ""

It should be fixed to get key code correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants