Looks like something is grabbing the on key pressed event in the TableView
(resultsTable in sample code). The following code correctly captures
Command+C on OS X and Ctrl+C on Ubuntu Linux. Enjoy!
public void enableShortcutC() {
resultsTable.addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent event)
-> {
if (event.getCode() == KeyCode.C && event.isShortcutDown()) {
LOGGER.info("Copy shortcut detected on table");
copySelectionToClipboard();
event.consume(); // Prevents the TableView from doing its own
handling
}
});
}
On Mon, Apr 6, 2026 at 1:50 PM Andy Goryachev <[email protected]>
wrote:
> I don't think copying ever worked with the TableView, possibly because the
> behavior is likely to be application-specific. Copying from the cell
> editor works, using a platform-appropriate key binding, since it's always
> plain text.
>
> -andy
>
>
>
> *From: *Chad Preisler <[email protected]>
> *Date: *Tuesday, March 31, 2026 at 14:47
> *To: *openjfx-dev <[email protected]>
> *Subject: *[External] : TableView key binding on OS X
>
> I recently noticed that Command+C does not copy text from the cell in my
> TableView on OS X. The key binding is always Ctrl+C to copy. I've tried to
> specifically check the OS and modifier and it still uses Ctrl+C. Does
> anyone else have this problem? I'm not sure if it's my code or a bug. I
> feel like this used to work.
>
> Command+C works in all my other text fields in the application. It's just
> the table having this issue.
>
> Here is the relevant code.
>
> https://gitlab.com/kafkasource/visualkafka/-/blob/main/visualkafka-ui/src/main/java/com/kafkasource/visualkafka/controller/TopicViewController.java?ref_type=heads#L169
>