2019-10-17 21:50:52 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
|
2019-10-26 18:05:22 -04:00
|
|
|
|
|
|
|
#include "pbd/convert.h"
|
|
|
|
|
2019-10-17 21:50:52 -04:00
|
|
|
#include "ardour/async_midi_port.h"
|
2019-10-20 14:53:40 -04:00
|
|
|
#include "ardour/session.h"
|
2019-10-26 18:05:22 -04:00
|
|
|
|
|
|
|
#include "gtkmm2ext/utils.h"
|
2019-10-19 20:43:39 -04:00
|
|
|
#include "widgets/tooltips.h"
|
2019-10-17 21:50:52 -04:00
|
|
|
|
|
|
|
#include "ardour_ui.h"
|
2019-10-18 11:26:25 -04:00
|
|
|
#include "ui_config.h"
|
2019-10-17 21:50:52 -04:00
|
|
|
#include "utils.h"
|
2019-10-21 10:06:29 -04:00
|
|
|
#include "virtual_keyboard_window.h"
|
2019-10-17 21:50:52 -04:00
|
|
|
|
|
|
|
#include "pbd/i18n.h"
|
|
|
|
|
|
|
|
using namespace Glib;
|
|
|
|
using namespace Gtk;
|
2019-10-18 11:26:25 -04:00
|
|
|
using namespace ArdourWidgets;
|
|
|
|
|
2019-10-21 10:06:29 -04:00
|
|
|
#define PX_SCALE(px) std::max ((float)px, rintf ((float)px* UIConfiguration::instance ().get_ui_scale ()))
|
2019-10-17 21:50:52 -04:00
|
|
|
|
|
|
|
VirtualKeyboardWindow::VirtualKeyboardWindow ()
|
2019-10-20 23:41:34 -04:00
|
|
|
: ArdourWindow (_("Virtual MIDI Keyboard"))
|
2019-10-19 20:43:39 -04:00
|
|
|
, _bank_msb (*manage (new Adjustment (0, 0, 127, 1, 16)))
|
|
|
|
, _bank_lsb (*manage (new Adjustment (0, 0, 127, 1, 16)))
|
|
|
|
, _patchpgm (*manage (new Adjustment (1, 1, 128, 1, 16)))
|
2019-11-01 21:43:56 -04:00
|
|
|
, _cfg_display (S_("Virtual keyboard|Config"), ArdourButton::led_default_elements)
|
|
|
|
, _pgm_display (_("Bank/Patch"), ArdourButton::led_default_elements)
|
|
|
|
, _yaxis_velocity (_("Y-Axis"), ArdourButton::led_default_elements)
|
|
|
|
, _send_panic (_("Panic"), ArdourButton::default_elements)
|
2019-10-18 11:26:25 -04:00
|
|
|
, _piano_key_velocity (*manage (new Adjustment (100, 1, 127, 1, 16)))
|
2019-10-21 10:06:29 -04:00
|
|
|
, _piano_min_velocity (*manage (new Adjustment ( 1, 1, 127, 1, 16)))
|
2019-10-18 11:26:25 -04:00
|
|
|
, _piano_max_velocity (*manage (new Adjustment (127, 1, 127, 1, 16)))
|
2019-10-20 23:41:34 -04:00
|
|
|
, _piano_octave_key (*manage (new Adjustment (4, -1, 7, 1, 1)))
|
|
|
|
, _piano_octave_range (*manage (new Adjustment (7, 2, 11, 1, 1)))
|
2019-10-20 12:29:23 -04:00
|
|
|
, _pitch_adjustment (8192, 0, 16383, 1, 256)
|
2019-10-17 21:50:52 -04:00
|
|
|
{
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.set_flags (Gtk::CAN_FOCUS);
|
|
|
|
|
2019-10-25 12:01:08 -04:00
|
|
|
_piano.set_keyboard_layout (APianoKeyboard::QWERTY);
|
2019-10-25 15:23:27 -04:00
|
|
|
_piano.set_annotate_octave (true);
|
|
|
|
_piano.set_grand_piano_highlight (false);
|
2019-10-26 18:05:22 -04:00
|
|
|
_piano.set_annotate_layout (true);
|
|
|
|
_piano.set_annotate_octave (true);
|
2019-10-17 21:50:52 -04:00
|
|
|
|
2019-10-25 17:52:53 -04:00
|
|
|
for (int c = 0; c < 16; ++c) {
|
|
|
|
char buf[16];
|
|
|
|
sprintf (buf, "%d", c + 1);
|
|
|
|
_midi_channel.append_text_item (buf);
|
|
|
|
}
|
|
|
|
for (int t = -12; t < 13; ++t) {
|
|
|
|
char buf[16];
|
|
|
|
sprintf (buf, "%d", t);
|
|
|
|
_transpose_output.append_text_item (buf);
|
|
|
|
}
|
|
|
|
|
2019-10-18 11:26:25 -04:00
|
|
|
using namespace Menu_Helpers;
|
2019-11-01 21:43:56 -04:00
|
|
|
_keyboard_layout.AddMenuElem (MenuElem (_("QWERTY"), sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::select_keyboard_layout), "QWERTY")));
|
|
|
|
_keyboard_layout.AddMenuElem (MenuElem (_("QWERTZ"), sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::select_keyboard_layout), "QWERTZ")));
|
|
|
|
_keyboard_layout.AddMenuElem (MenuElem (_("AZERTY"), sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::select_keyboard_layout), "AZERTY")));
|
|
|
|
_keyboard_layout.AddMenuElem (MenuElem (_("DVORAK"), sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::select_keyboard_layout), "DVORAK")));
|
|
|
|
_keyboard_layout.AddMenuElem (MenuElem (_("QWERTY Single"), sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::select_keyboard_layout), "QWERTY Single")));
|
|
|
|
_keyboard_layout.AddMenuElem (MenuElem (_("QWERTZ Single"), sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::select_keyboard_layout), "QWERTZ Single")));
|
|
|
|
|
|
|
|
Gtkmm2ext::set_size_request_to_display_given_text_width (_keyboard_layout, _("QWERTZ Single"), 2, 0); // Longest Text
|
|
|
|
_keyboard_layout.set_active (_("QWERTY"));
|
2019-10-25 17:52:53 -04:00
|
|
|
_midi_channel.set_active ("1");
|
|
|
|
_transpose_output.set_active ("0");
|
2019-10-18 11:26:25 -04:00
|
|
|
|
2019-10-19 20:43:39 -04:00
|
|
|
_cfg_display.set_active (false);
|
|
|
|
_pgm_display.set_active (false);
|
2019-10-18 11:26:25 -04:00
|
|
|
_yaxis_velocity.set_active (false);
|
|
|
|
|
2019-10-23 23:13:56 -04:00
|
|
|
_send_panic.set_can_focus (false);
|
|
|
|
|
2019-10-21 10:06:29 -04:00
|
|
|
_pitchbend = boost::shared_ptr<VKBDControl> (new VKBDControl ("PB", 8192, 16383));
|
|
|
|
_pitch_slider = manage (new VSliderController (&_pitch_adjustment, _pitchbend, 0, PX_SCALE (15)));
|
2019-10-20 12:29:23 -04:00
|
|
|
_pitch_slider_tooltip = new Gtkmm2ext::PersistentTooltip (_pitch_slider);
|
2019-10-21 10:06:29 -04:00
|
|
|
|
|
|
|
_pitch_adjustment.signal_value_changed ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::pitch_slider_adjusted));
|
|
|
|
_pitchbend->ValueChanged.connect_same_thread (_cc_connections, boost::bind (&VirtualKeyboardWindow::pitch_bend_event_handler, this, _1));
|
2019-10-18 11:26:25 -04:00
|
|
|
|
2019-11-01 21:43:56 -04:00
|
|
|
set_tooltip (_yaxis_velocity, _("When enabled, mouse-click y-axis position defines the velocity."));
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-11-01 21:43:56 -04:00
|
|
|
set_tooltip (_piano_octave_key, _("The center octave, and lowest octave for keyboard control. Change with Arrow left/right."));
|
|
|
|
set_tooltip (_piano_octave_range, _("Available octave range, centered around the key-octave."));
|
|
|
|
set_tooltip (_keyboard_layout, _("Keyboard layout to use for keyboard control."));
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-11-01 21:43:56 -04:00
|
|
|
set_tooltip (_piano_key_velocity, _("The default velocity to use with keyboard control, and when y-axis click-position is disabled."));
|
|
|
|
set_tooltip (_piano_min_velocity, _("Velocity to use when clicking at the top-end of a key."));
|
|
|
|
set_tooltip (_piano_max_velocity, _("Velocity to use when clicking at the bottom-end of a key."));
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-11-01 21:43:56 -04:00
|
|
|
set_tooltip (_send_panic, _("Send MIDI Panic message for current channel"));
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-11-01 21:43:56 -04:00
|
|
|
_pitch_slider_tooltip->set_tip (_("Pitchbend: ") + std::string ("8192"));
|
2019-10-23 23:13:56 -04:00
|
|
|
_pitch_slider->set_can_focus (false);
|
2019-10-18 11:26:25 -04:00
|
|
|
|
|
|
|
/* config */
|
2019-10-20 23:41:34 -04:00
|
|
|
Table* cfg_tbl = manage (new Table);
|
2019-10-26 18:05:22 -04:00
|
|
|
cfg_tbl->attach (_yaxis_velocity, 0, 1, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (*manage (new Label (_("Velocity:"))), 0, 1, 1, 2, SHRINK, SHRINK, 4, 0);
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-10-26 18:05:22 -04:00
|
|
|
cfg_tbl->attach (_piano_min_velocity, 1, 2, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (*manage (new Label (_("Min"))), 1, 2, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (_piano_max_velocity, 2, 3, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (*manage (new Label (_("Max"))), 2, 3, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (_piano_key_velocity, 3, 4, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (*manage (new Label (_("Key"))), 3, 4, 1, 2, SHRINK, SHRINK, 4, 0);
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-10-26 18:05:22 -04:00
|
|
|
cfg_tbl->attach (*manage (new ArdourVSpacer), 4, 5, 0, 2, SHRINK, FILL, 4, 0);
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-10-26 18:05:22 -04:00
|
|
|
cfg_tbl->attach (_piano_octave_key, 5, 6, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (*manage (new Label (_("Octave"))), 5, 6, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (_piano_octave_range, 6, 7, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
cfg_tbl->attach (*manage (new Label (_("Range"))), 6, 7, 1, 2, SHRINK, SHRINK, 4, 0);
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-10-26 18:05:22 -04:00
|
|
|
cfg_tbl->attach (*manage (new ArdourVSpacer), 7, 8, 0, 2, SHRINK, FILL, 4, 0);
|
2019-10-20 23:41:34 -04:00
|
|
|
|
2019-10-26 18:05:22 -04:00
|
|
|
cfg_tbl->attach (_keyboard_layout, 8, 9, 0, 2, FILL, SHRINK, 4, 1);
|
2019-10-20 23:41:34 -04:00
|
|
|
cfg_tbl->show_all ();
|
2019-10-19 20:43:39 -04:00
|
|
|
|
|
|
|
/* bank/patch */
|
|
|
|
Table* pgm_tbl = manage (new Table);
|
|
|
|
|
|
|
|
Label* lbl = manage (new Label (_("Note: Prefer\nTrack-controls")));
|
|
|
|
lbl->set_justify (JUSTIFY_CENTER);
|
|
|
|
|
2019-10-21 10:06:29 -04:00
|
|
|
pgm_tbl->attach (*lbl, 0, 1, 0, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
pgm_tbl->attach (*manage (new ArdourVSpacer), 1, 2, 0, 2, SHRINK, FILL, 4, 0);
|
|
|
|
pgm_tbl->attach (_bank_msb, 2, 3, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
pgm_tbl->attach (_bank_lsb, 3, 4, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
pgm_tbl->attach (_patchpgm, 4, 5, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
pgm_tbl->attach (*manage (new Label (_("MSB"))), 2, 3, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
pgm_tbl->attach (*manage (new Label (_("LSB"))), 3, 4, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
pgm_tbl->attach (*manage (new Label (_("PGM"))), 4, 5, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
pgm_tbl->attach (*manage (new ArdourVSpacer), 5, 6, 0, 2, SHRINK, FILL, 4, 0);
|
|
|
|
pgm_tbl->attach (_send_panic, 6, 7, 0, 2, SHRINK, SHRINK, 4, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
pgm_tbl->show_all ();
|
2019-10-18 11:26:25 -04:00
|
|
|
|
|
|
|
/* settings */
|
2019-10-19 20:43:39 -04:00
|
|
|
Table* tbl = manage (new Table);
|
2019-10-25 17:52:53 -04:00
|
|
|
tbl->attach (_midi_channel, 0, 1, 0, 1, SHRINK, SHRINK, 4, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
tbl->attach (*manage (new Label (_("Channel"))), 0, 1, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
tbl->attach (*manage (new ArdourVSpacer), 1, 2, 0, 2, SHRINK, FILL, 4, 0);
|
2019-10-20 12:29:23 -04:00
|
|
|
tbl->attach (*_pitch_slider, 2, 3, 0, 2, SHRINK, FILL, 4, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
|
|
|
|
const char* default_cc[VKBD_NCTRLS] = { "7", "8", "1", "11", "91", "92", "93", "94" };
|
|
|
|
|
2019-10-21 13:31:25 -04:00
|
|
|
int col = 3;
|
|
|
|
for (int i = 0; i < VKBD_NCTRLS; ++i, ++col) {
|
2019-10-21 10:06:29 -04:00
|
|
|
_cc[i] = boost::shared_ptr<VKBDControl> (new VKBDControl ("CC"));
|
|
|
|
_cc_knob[i] = manage (new ArdourKnob (ArdourKnob::default_elements, ArdourKnob::Flags (0)));
|
2019-10-19 20:43:39 -04:00
|
|
|
_cc_knob[i]->set_controllable (_cc[i]);
|
2019-10-21 10:06:29 -04:00
|
|
|
_cc_knob[i]->set_size_request (PX_SCALE (21), PX_SCALE (21));
|
2019-10-19 20:43:39 -04:00
|
|
|
_cc_knob[i]->set_tooltip_prefix (_("CC: "));
|
|
|
|
_cc_knob[i]->set_name ("monitor section knob");
|
|
|
|
|
|
|
|
for (int c = 1; c < 120; ++c) {
|
|
|
|
if (c == 32) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
char key[32];
|
|
|
|
sprintf (key, "%d", c);
|
|
|
|
_cc_key[i].append_text_item (key);
|
|
|
|
}
|
2019-10-20 15:22:38 -04:00
|
|
|
_cc_key[i].set_active (default_cc[i]);
|
2019-10-19 20:43:39 -04:00
|
|
|
|
2019-10-21 13:31:25 -04:00
|
|
|
tbl->attach (*_cc_knob[i], col, col + 1, 0, 1, SHRINK, SHRINK, 4, 2);
|
|
|
|
tbl->attach (_cc_key[i], col, col + 1, 1, 2, SHRINK, SHRINK, 4, 2);
|
2019-10-19 20:43:39 -04:00
|
|
|
|
|
|
|
_cc[i]->ValueChanged.connect_same_thread (_cc_connections,
|
2019-10-21 10:06:29 -04:00
|
|
|
boost::bind (&VirtualKeyboardWindow::control_change_event_handler, this, i, _1));
|
2019-10-19 20:43:39 -04:00
|
|
|
}
|
|
|
|
|
2019-10-21 13:31:25 -04:00
|
|
|
tbl->attach (*manage (new ArdourVSpacer), col, col + 1, 0, 2, SHRINK, FILL, 4, 0);
|
|
|
|
++col;
|
|
|
|
tbl->attach (_transpose_output, col, col + 1, 0, 1, SHRINK, SHRINK, 4, 0);
|
|
|
|
tbl->attach (*manage (new Label (_("Transpose"))), col, col + 1, 1, 2, SHRINK, SHRINK, 4, 0);
|
|
|
|
|
2019-10-19 20:43:39 -04:00
|
|
|
/* main layout */
|
2019-10-18 11:26:25 -04:00
|
|
|
Box* box1 = manage (new HBox ());
|
2019-10-19 20:43:39 -04:00
|
|
|
box1->pack_start (*tbl, true, false);
|
|
|
|
|
|
|
|
Box* box2 = manage (new VBox ());
|
2019-10-21 09:27:42 -04:00
|
|
|
box2->pack_start (_pgm_display, false, false, 1);
|
|
|
|
box2->pack_start (_cfg_display, false, false, 1);
|
2019-10-19 20:43:39 -04:00
|
|
|
box1->pack_start (*box2, false, false);
|
|
|
|
|
|
|
|
_cfg_box = manage (new HBox ());
|
2019-10-20 23:41:34 -04:00
|
|
|
_cfg_box->pack_start (*cfg_tbl, true, false);
|
2019-10-19 20:43:39 -04:00
|
|
|
_cfg_box->set_no_show_all (true);
|
|
|
|
|
|
|
|
_pgm_box = manage (new HBox ());
|
|
|
|
_pgm_box->pack_start (*pgm_tbl, true, false);
|
|
|
|
_pgm_box->set_no_show_all (true);
|
|
|
|
|
2019-10-17 21:50:52 -04:00
|
|
|
VBox* vbox = manage (new VBox);
|
2019-10-18 11:26:25 -04:00
|
|
|
vbox->pack_start (*box1, false, false, 4);
|
2019-10-19 20:43:39 -04:00
|
|
|
vbox->pack_start (*_pgm_box, false, false, 4);
|
|
|
|
vbox->pack_start (*_cfg_box, false, false, 4);
|
2019-10-24 13:43:46 -04:00
|
|
|
vbox->pack_start (_piano, true, true);
|
2019-10-17 21:50:52 -04:00
|
|
|
add (*vbox);
|
|
|
|
|
2019-10-19 20:43:39 -04:00
|
|
|
_bank_msb.signal_value_changed ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::bank_patch));
|
|
|
|
_bank_lsb.signal_value_changed ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::bank_patch));
|
|
|
|
_patchpgm.signal_value_changed ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::bank_patch));
|
|
|
|
|
2019-10-18 11:26:25 -04:00
|
|
|
_piano_key_velocity.signal_value_changed ().connect (sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::update_velocity_settings), 0));
|
|
|
|
_piano_min_velocity.signal_value_changed ().connect (sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::update_velocity_settings), 1));
|
|
|
|
_piano_max_velocity.signal_value_changed ().connect (sigc::bind (sigc::mem_fun (*this, &VirtualKeyboardWindow::update_velocity_settings), 2));
|
|
|
|
|
2019-10-20 23:41:34 -04:00
|
|
|
_piano_octave_key.signal_value_changed ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::update_octave_key));
|
|
|
|
_piano_octave_range.signal_value_changed ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::update_octave_range));
|
|
|
|
|
2019-10-21 10:06:29 -04:00
|
|
|
_cfg_display.signal_button_release_event ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::toggle_config), false);
|
|
|
|
_pgm_display.signal_button_release_event ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::toggle_bankpatch), false);
|
|
|
|
_yaxis_velocity.signal_button_release_event ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::toggle_yaxis_velocity), false);
|
|
|
|
_send_panic.signal_button_release_event ().connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::send_panic_message), false);
|
2019-10-18 11:26:25 -04:00
|
|
|
|
2019-10-24 13:43:46 -04:00
|
|
|
|
|
|
|
_piano.NoteOn.connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::note_on_event_handler));
|
|
|
|
_piano.NoteOff.connect (sigc::mem_fun (*this, &VirtualKeyboardWindow::note_off_event_handler));
|
2019-10-18 11:26:25 -04:00
|
|
|
|
|
|
|
update_velocity_settings (0);
|
2019-10-21 09:27:42 -04:00
|
|
|
update_octave_range ();
|
2019-10-18 11:26:25 -04:00
|
|
|
|
2019-10-17 21:50:52 -04:00
|
|
|
set_keep_above (true);
|
2019-10-21 10:06:29 -04:00
|
|
|
vbox->show_all ();
|
2019-10-17 21:50:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
VirtualKeyboardWindow::~VirtualKeyboardWindow ()
|
|
|
|
{
|
2019-10-20 12:29:23 -04:00
|
|
|
delete _pitch_slider_tooltip;
|
2019-10-17 21:50:52 -04:00
|
|
|
}
|
|
|
|
|
2019-10-20 14:53:40 -04:00
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::set_session (ARDOUR::Session* s)
|
|
|
|
{
|
|
|
|
ArdourWindow::set_session (s);
|
|
|
|
|
|
|
|
if (!_session) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-10-21 10:06:29 -04:00
|
|
|
XMLNode* node = _session->instant_xml (X_("VirtualKeyboard"));
|
2019-10-20 14:53:40 -04:00
|
|
|
if (node) {
|
|
|
|
set_state (*node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLNode&
|
|
|
|
VirtualKeyboardWindow::get_state ()
|
|
|
|
{
|
|
|
|
XMLNode* node = new XMLNode (X_("VirtualKeyboard"));
|
2019-10-21 10:06:29 -04:00
|
|
|
node->set_property (X_("YAxisVelocity"), _yaxis_velocity.get_active ());
|
2019-10-20 14:53:40 -04:00
|
|
|
node->set_property (X_("Layout"), _keyboard_layout.get_text ());
|
2019-10-25 17:52:53 -04:00
|
|
|
node->set_property (X_("Channel"), _midi_channel.get_text ());
|
|
|
|
node->set_property (X_("Transpose"), _transpose_output.get_text ());
|
2019-10-20 14:53:40 -04:00
|
|
|
node->set_property (X_("MinVelocity"), _piano_min_velocity.get_value_as_int ());
|
|
|
|
node->set_property (X_("MaxVelocity"), _piano_max_velocity.get_value_as_int ());
|
|
|
|
node->set_property (X_("KeyVelocity"), _piano_key_velocity.get_value_as_int ());
|
2019-10-21 09:27:42 -04:00
|
|
|
node->set_property (X_("Octave"), _piano_octave_key.get_value_as_int ());
|
|
|
|
node->set_property (X_("Range"), _piano_octave_range.get_value_as_int ());
|
2019-10-20 14:53:40 -04:00
|
|
|
for (int i = 0; i < VKBD_NCTRLS; ++i) {
|
|
|
|
char buf[16];
|
|
|
|
sprintf (buf, "CC-%d", i);
|
2019-10-21 10:06:29 -04:00
|
|
|
node->set_property (buf, _cc_key[i].get_text ());
|
2019-10-20 14:53:40 -04:00
|
|
|
}
|
|
|
|
return *node;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2019-10-21 10:06:29 -04:00
|
|
|
VirtualKeyboardWindow::set_state (const XMLNode& root)
|
2019-10-20 14:53:40 -04:00
|
|
|
{
|
2019-10-21 10:06:29 -04:00
|
|
|
if (root.name () != "VirtualKeyboard") {
|
2019-10-20 14:53:40 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLNode const* node = &root;
|
|
|
|
|
|
|
|
std::string layout;
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (X_("Layout"), layout)) {
|
2019-10-24 13:43:46 -04:00
|
|
|
select_keyboard_layout (layout);
|
2019-10-20 14:53:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < VKBD_NCTRLS; ++i) {
|
|
|
|
char buf[16];
|
|
|
|
sprintf (buf, "CC-%d", i);
|
|
|
|
std::string cckey;
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (buf, cckey)) {
|
2019-10-20 15:22:38 -04:00
|
|
|
_cc_key[i].set_active (cckey);
|
2019-10-20 14:53:40 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-25 17:52:53 -04:00
|
|
|
std::string s;
|
|
|
|
if (node->get_property (X_("Channel"), s)) {
|
|
|
|
uint8_t channel = PBD::atoi (_midi_channel.get_text ());
|
|
|
|
if (channel > 0 && channel < 17) {
|
|
|
|
_midi_channel.set_active (s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (node->get_property (X_("Transpose"), s)) {
|
|
|
|
_transpose_output.set_active (s);
|
|
|
|
}
|
|
|
|
|
2019-10-20 14:53:40 -04:00
|
|
|
bool a;
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (X_("YAxisVelocity"), a)) {
|
2019-10-21 09:27:42 -04:00
|
|
|
_yaxis_velocity.set_active (a);
|
|
|
|
}
|
2019-10-20 14:53:40 -04:00
|
|
|
|
|
|
|
int v;
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (X_("MinVelocity"), v)) {
|
2019-10-20 14:53:40 -04:00
|
|
|
_piano_min_velocity.set_value (v);
|
|
|
|
}
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (X_("MaxVelocity"), v)) {
|
2019-10-20 14:53:40 -04:00
|
|
|
_piano_max_velocity.set_value (v);
|
|
|
|
}
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (X_("KeyVelocity"), v)) {
|
2019-10-20 14:53:40 -04:00
|
|
|
_piano_key_velocity.set_value (v);
|
|
|
|
}
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (X_("Octave"), v)) {
|
2019-10-21 09:27:42 -04:00
|
|
|
_piano_octave_key.set_value (v);
|
|
|
|
}
|
2019-10-21 10:06:29 -04:00
|
|
|
if (node->get_property (X_("Range"), v)) {
|
2019-10-21 09:27:42 -04:00
|
|
|
_piano_octave_range.set_value (v);
|
|
|
|
}
|
2019-10-20 14:53:40 -04:00
|
|
|
|
|
|
|
update_velocity_settings (0);
|
2019-10-21 09:27:42 -04:00
|
|
|
update_octave_range ();
|
|
|
|
update_octave_key ();
|
2019-10-20 14:53:40 -04:00
|
|
|
}
|
|
|
|
|
2019-10-23 23:13:56 -04:00
|
|
|
bool
|
2019-10-25 08:35:38 -04:00
|
|
|
VirtualKeyboardWindow::on_focus_in_event (GdkEventFocus* ev)
|
2019-10-23 23:13:56 -04:00
|
|
|
{
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.grab_focus ();
|
2019-10-25 08:35:38 -04:00
|
|
|
return ArdourWindow::on_focus_in_event (ev);
|
2019-10-23 23:13:56 -04:00
|
|
|
}
|
|
|
|
|
2019-10-17 21:50:52 -04:00
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::on_unmap ()
|
|
|
|
{
|
|
|
|
ArdourWindow::on_unmap ();
|
2019-10-21 10:06:29 -04:00
|
|
|
ARDOUR_UI::instance ()->reset_focus (this);
|
2019-10-17 21:50:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
VirtualKeyboardWindow::on_key_press_event (GdkEventKey* ev)
|
|
|
|
{
|
2019-10-25 15:23:27 -04:00
|
|
|
/* try propagate unmodified events first */
|
|
|
|
if ((ev->state & 0xf) == 0) {
|
|
|
|
if (gtk_window_propagate_key_event (gobj(), ev)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-25 15:54:16 -04:00
|
|
|
_piano.grab_focus ();
|
|
|
|
|
2019-10-25 15:23:27 -04:00
|
|
|
/* handle up/down */
|
2019-11-02 18:52:29 -04:00
|
|
|
// XXX consider to handle these in APianoKeyboard::on_key_press_event
|
|
|
|
// and use signals. -- also subscribe SustainChanged, indicate sustain.
|
|
|
|
// TODO: pitch-bend shortcuts
|
2019-10-25 15:23:27 -04:00
|
|
|
if (ev->type == GDK_KEY_PRESS) {
|
|
|
|
if (ev->keyval == GDK_KEY_Left) {
|
|
|
|
_piano_octave_key.set_value (_piano_octave_key.get_value_as_int () - 1);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (ev->keyval == GDK_KEY_Right) {
|
|
|
|
_piano_octave_key.set_value (_piano_octave_key.get_value_as_int () + 1);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-17 21:50:52 -04:00
|
|
|
return ARDOUR_UI_UTILS::relay_key_press (ev, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2019-10-21 09:27:42 -04:00
|
|
|
VirtualKeyboardWindow::select_keyboard_layout (std::string const& l)
|
2019-10-18 11:26:25 -04:00
|
|
|
{
|
2019-10-26 18:05:22 -04:00
|
|
|
_keyboard_layout.set_active (l);
|
2019-10-24 13:43:46 -04:00
|
|
|
if (l == "QWERTY") {
|
2019-10-25 12:01:08 -04:00
|
|
|
_piano.set_keyboard_layout (APianoKeyboard::QWERTY);
|
2019-10-24 13:43:46 -04:00
|
|
|
} else if (l == "QWERTZ") {
|
2019-10-25 12:01:08 -04:00
|
|
|
_piano.set_keyboard_layout (APianoKeyboard::QWERTZ);
|
2019-10-24 13:43:46 -04:00
|
|
|
} else if (l == "AZERTY") {
|
2019-10-25 12:01:08 -04:00
|
|
|
_piano.set_keyboard_layout (APianoKeyboard::AZERTY);
|
2019-10-24 13:43:46 -04:00
|
|
|
} else if (l == "DVORAK") {
|
2019-10-25 12:01:08 -04:00
|
|
|
_piano.set_keyboard_layout (APianoKeyboard::DVORAK);
|
2019-10-26 18:05:22 -04:00
|
|
|
} else if (l == "QWERTY Single") {
|
|
|
|
_piano.set_keyboard_layout (APianoKeyboard::S_QWERTY);
|
|
|
|
} else if (l == "QWERTZ Single") {
|
|
|
|
_piano.set_keyboard_layout (APianoKeyboard::S_QWERTZ);
|
|
|
|
} else {
|
|
|
|
_keyboard_layout.set_active ("QWERTY");
|
2019-10-24 13:43:46 -04:00
|
|
|
}
|
2019-10-26 18:05:22 -04:00
|
|
|
_piano.grab_focus ();
|
2019-10-18 11:26:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2019-10-19 20:43:39 -04:00
|
|
|
VirtualKeyboardWindow::toggle_config (GdkEventButton* ev)
|
|
|
|
{
|
2019-10-21 10:06:29 -04:00
|
|
|
bool a = !_cfg_display.get_active ();
|
2019-10-19 20:43:39 -04:00
|
|
|
_cfg_display.set_active (a);
|
|
|
|
if (a) {
|
|
|
|
_cfg_box->show ();
|
|
|
|
} else {
|
|
|
|
_cfg_box->hide ();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
VirtualKeyboardWindow::toggle_bankpatch (GdkEventButton*)
|
|
|
|
{
|
2019-10-21 10:06:29 -04:00
|
|
|
bool a = !_pgm_display.get_active ();
|
2019-10-19 20:43:39 -04:00
|
|
|
_pgm_display.set_active (a);
|
|
|
|
if (a) {
|
|
|
|
_pgm_box->show ();
|
|
|
|
} else {
|
|
|
|
_pgm_box->hide ();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-10-20 23:41:34 -04:00
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::update_octave_key ()
|
|
|
|
{
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.set_octave (_piano_octave_key.get_value_as_int ());
|
|
|
|
_piano.grab_focus ();
|
2019-10-20 23:41:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::update_octave_range ()
|
|
|
|
{
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.set_octave_range (_piano_octave_range.get_value_as_int ());
|
2019-10-26 18:05:22 -04:00
|
|
|
_piano.set_grand_piano_highlight (_piano_octave_range.get_value_as_int () > 3);
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.grab_focus ();
|
2019-10-20 23:41:34 -04:00
|
|
|
}
|
|
|
|
|
2019-10-19 20:43:39 -04:00
|
|
|
bool
|
|
|
|
VirtualKeyboardWindow::toggle_yaxis_velocity (GdkEventButton*)
|
2019-10-18 11:26:25 -04:00
|
|
|
{
|
|
|
|
_yaxis_velocity.set_active (!_yaxis_velocity.get_active ());
|
|
|
|
update_velocity_settings (0);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-10-19 20:43:39 -04:00
|
|
|
bool
|
|
|
|
VirtualKeyboardWindow::send_panic_message (GdkEventButton*)
|
|
|
|
{
|
2019-10-25 17:52:53 -04:00
|
|
|
uint8_t channel = PBD::atoi (_midi_channel.get_text ()) - 1;
|
2019-10-19 20:43:39 -04:00
|
|
|
uint8_t ev[3];
|
|
|
|
ev[0] = MIDI_CMD_CONTROL | channel;
|
|
|
|
ev[1] = MIDI_CTL_SUSTAIN;
|
|
|
|
ev[2] = 0;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
ev[1] = MIDI_CTL_ALL_NOTES_OFF;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
ev[1] = MIDI_CTL_RESET_CONTROLLERS;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::bank_patch ()
|
|
|
|
{
|
|
|
|
int msb = _bank_msb.get_value_as_int ();
|
|
|
|
int lsb = _bank_lsb.get_value_as_int ();
|
|
|
|
int pgm = _patchpgm.get_value_as_int () - 1;
|
|
|
|
|
2019-10-25 17:52:53 -04:00
|
|
|
uint8_t channel = PBD::atoi (_midi_channel.get_text ()) - 1;
|
2019-10-19 20:43:39 -04:00
|
|
|
uint8_t ev[3];
|
|
|
|
ev[0] = MIDI_CMD_CONTROL | channel;
|
|
|
|
ev[1] = MIDI_CTL_MSB_BANK;
|
|
|
|
ev[2] = (msb >> 7) & 0x7f;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
ev[1] = MIDI_CTL_LSB_BANK | channel;
|
|
|
|
ev[2] = lsb & 0x7f;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
ev[0] = MIDI_CMD_PGM_CHANGE | channel;
|
|
|
|
ev[1] = pgm & 0x7f;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 2, 0);
|
2019-10-19 20:43:39 -04:00
|
|
|
}
|
|
|
|
|
2019-10-18 11:26:25 -04:00
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::update_velocity_settings (int ctrl)
|
|
|
|
{
|
|
|
|
if (_piano_min_velocity.get_value_as_int () > _piano_max_velocity.get_value_as_int ()) {
|
|
|
|
if (ctrl == 2) {
|
|
|
|
_piano_min_velocity.set_value (_piano_max_velocity.get_value_as_int ());
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
_piano_max_velocity.set_value (_piano_min_velocity.get_value_as_int ());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_yaxis_velocity.get_active ()) {
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.set_velocities (_piano_min_velocity.get_value_as_int (),
|
|
|
|
_piano_max_velocity.get_value_as_int (),
|
|
|
|
_piano_key_velocity.get_value_as_int ());
|
2019-10-18 11:26:25 -04:00
|
|
|
} else {
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.set_velocities (_piano_key_velocity.get_value_as_int (),
|
|
|
|
_piano_key_velocity.get_value_as_int (),
|
|
|
|
_piano_key_velocity.get_value_as_int ());
|
2019-10-18 11:26:25 -04:00
|
|
|
}
|
|
|
|
update_sensitivity ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::update_sensitivity ()
|
|
|
|
{
|
|
|
|
bool c = _yaxis_velocity.get_active ();
|
|
|
|
_piano_min_velocity.set_sensitive (c);
|
|
|
|
_piano_max_velocity.set_sensitive (c);
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.grab_focus ();
|
2019-10-18 11:26:25 -04:00
|
|
|
}
|
|
|
|
|
2019-10-20 12:29:23 -04:00
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::pitch_slider_adjusted ()
|
|
|
|
{
|
|
|
|
_pitchbend->set_value (_pitch_adjustment.get_value (), PBD::Controllable::NoGroup);
|
|
|
|
char buf[64];
|
2019-11-01 21:43:56 -04:00
|
|
|
snprintf (buf, sizeof (buf), "%.0f", _pitch_adjustment.get_value ());
|
|
|
|
_pitch_slider_tooltip->set_tip (_("Pitchbend: ") + std::string(buf));
|
2019-10-20 12:29:23 -04:00
|
|
|
}
|
|
|
|
|
2019-10-18 11:26:25 -04:00
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::note_on_event_handler (int note, int velocity)
|
2019-10-17 21:50:52 -04:00
|
|
|
{
|
2019-10-24 13:43:46 -04:00
|
|
|
_piano.grab_focus ();
|
2019-10-17 21:50:52 -04:00
|
|
|
if (!_session) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-25 17:52:53 -04:00
|
|
|
note += PBD::atoi (_transpose_output.get_text ());
|
2019-10-21 13:31:25 -04:00
|
|
|
if (note < 0 || note > 127) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-25 17:52:53 -04:00
|
|
|
uint8_t channel = PBD::atoi (_midi_channel.get_text ()) - 1;
|
2019-10-17 21:50:52 -04:00
|
|
|
uint8_t ev[3];
|
2019-10-20 12:29:23 -04:00
|
|
|
ev[0] = MIDI_CMD_NOTE_ON | channel;
|
2019-10-17 21:50:52 -04:00
|
|
|
ev[1] = note;
|
2019-10-18 11:26:25 -04:00
|
|
|
ev[2] = velocity;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-17 21:50:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::note_off_event_handler (int note)
|
|
|
|
{
|
|
|
|
if (!_session) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-25 17:52:53 -04:00
|
|
|
note += PBD::atoi (_transpose_output.get_text ());
|
2019-10-21 13:31:25 -04:00
|
|
|
if (note < 0 || note > 127) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-25 17:52:53 -04:00
|
|
|
uint8_t channel = PBD::atoi (_midi_channel.get_text ()) - 1;
|
2019-10-17 21:50:52 -04:00
|
|
|
uint8_t ev[3];
|
2019-10-20 12:29:23 -04:00
|
|
|
ev[0] = MIDI_CMD_NOTE_OFF | channel;
|
2019-10-17 21:50:52 -04:00
|
|
|
ev[1] = note;
|
|
|
|
ev[2] = 0;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-17 21:50:52 -04:00
|
|
|
}
|
2019-10-18 11:26:25 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::control_change_event_handler (int key, int val)
|
|
|
|
{
|
2019-10-20 12:29:23 -04:00
|
|
|
if (!_session) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-19 20:43:39 -04:00
|
|
|
assert (key >= 0 && key < VKBD_NCTRLS);
|
2019-10-21 10:06:29 -04:00
|
|
|
int ctrl = PBD::atoi (_cc_key[key].get_text ());
|
2019-10-19 20:43:39 -04:00
|
|
|
assert (ctrl > 0 && ctrl < 127);
|
2019-10-25 17:52:53 -04:00
|
|
|
uint8_t channel = PBD::atoi (_midi_channel.get_text ()) - 1;
|
2019-10-18 11:26:25 -04:00
|
|
|
uint8_t ev[3];
|
2019-10-20 12:29:23 -04:00
|
|
|
ev[0] = MIDI_CMD_CONTROL | channel;
|
2019-10-19 20:43:39 -04:00
|
|
|
ev[1] = ctrl;
|
2019-10-18 11:26:25 -04:00
|
|
|
ev[2] = val;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-18 11:26:25 -04:00
|
|
|
}
|
2019-10-20 12:29:23 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
VirtualKeyboardWindow::pitch_bend_event_handler (int val)
|
|
|
|
{
|
|
|
|
if (!_session) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-25 17:52:53 -04:00
|
|
|
uint8_t channel = PBD::atoi (_midi_channel.get_text ()) - 1;
|
2019-10-20 12:29:23 -04:00
|
|
|
uint8_t ev[3];
|
|
|
|
ev[0] = MIDI_CMD_BENDER | channel;
|
|
|
|
ev[1] = val & 0x7f;
|
|
|
|
ev[2] = (val >> 7) & 0x7f;
|
2019-10-21 10:06:29 -04:00
|
|
|
_session->vkbd_output_port ()->write (ev, 3, 0);
|
2019-10-20 12:29:23 -04:00
|
|
|
}
|