10000 #572 Can send message to the monitor with `Enter` by kittaakos · Pull Request #1402 · arduino/arduino-ide · GitHub
[go: up one dir, main page]

Skip to content

#572 Can send message to the monitor with Enter #1402

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

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Can send message to the monitor with Enter.
Removed the required `Ctrl/Cmd` modifier.

Closes #572

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Sep 5, 2022
commit f52143f6665bd3fb77416537d6bb31a0abf8b6d2
10000
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from '@theia/core/shared/react';
import { Key, KeyCode } from '@theia/core/lib/browser/keys';
import { Board } from '../../../common/protocol/boards-service';
import { isOSX } from '@theia/core/lib/common/os';
import { DisposableCollection, nls } from '@theia/core/lib/common';
import { BoardsServiceProvider } from '../../boards/boards-service-provider';
import { MonitorModel } from '../../monitor-model';
Expand Down Expand Up @@ -81,8 +80,7 @@ export class SerialMonitorSendInput extends React.Component<
const port = this.props.boardsServiceProvider.boardsConfig.selectedPort;
return nls.localize(
'arduino/serial/message',
"Message ({0} + Enter to send message to '{1}' on '{2}')",
isOSX ? '⌘' : nls.localize('vscode/keybindingLabels/ctrlKey', 'Ctrl'),
"Message (Enter to send message to '{0}' on '{1}')",
board
? Board.toString(board, {
useFqbn: false,
Expand Down Expand Up @@ -110,8 +108,8 @@ export class SerialMonitorSendInput extends React.Component<
protected onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {
const keyCode = KeyCode.createKeyCode(event.nativeEvent);
if (keyCode) {
const { key, meta, ctrl } = keyCode;
if (key === Key.ENTER && ((isOSX && meta) || (!isOSX && ctrl))) {
const { key } = keyCode;
if (key === Key.ENTER) {
this.onSend();
}
}
Expand Down
2 changes: 1 addition & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
"serial": {
"autoscroll": "Autoscroll",
"carriageReturn": "Carriage Return",
"message": "Message ({0} + Enter to send message to '{1}' on '{2}')",
"message": "Message (Enter to send message to '{0}' on '{1}')",
"newLine": "New Line",
"newLineCarriageReturn": "Both NL & CR",
"noLineEndings": "No Line Ending",
Expand Down
0