This commit is contained in:
Robbbert 2018-08-11 01:50:09 +10:00
commit 4ddd14dbad
2 changed files with 13 additions and 0 deletions

View File

@ -323,6 +323,7 @@ natural_keyboard::natural_keyboard(running_machine &machine)
, m_fieldnum(0) , m_fieldnum(0)
, m_status_keydown(false) , m_status_keydown(false)
, m_last_cr(false) , m_last_cr(false)
, m_post_lf(false)
, m_timer(nullptr) , m_timer(nullptr)
, m_current_rate(attotime::zero) , m_current_rate(attotime::zero)
, m_queue_chars() , m_queue_chars()
@ -412,8 +413,14 @@ void natural_keyboard::post(char32_t ch)
// can we post this key in the queue directly? // can we post this key in the queue directly?
if (can_post_directly(ch)) if (can_post_directly(ch))
{
internal_post(ch); internal_post(ch);
// post LF with CR
if (ch == '\r' && m_post_lf)
internal_post('\n');
}
// can we post this key with an alternate representation? // can we post this key with an alternate representation?
else if (can_post_alternate(ch)) else if (can_post_alternate(ch))
{ {
@ -640,6 +647,11 @@ void natural_keyboard::build_codes(ioport_manager &manager)
machine().logerror("natural_keyboard: code=%u (%s) port=%p field.name='%s'\n", machine().logerror("natural_keyboard: code=%u (%s) port=%p field.name='%s'\n",
code, unicode_to_string(code), (void *)&port, field.name()); code, unicode_to_string(code), (void *)&port, field.name());
} }
// check for line feed key
if (code == '\n' && curshift == 0)
m_post_lf = true;
} }
} }
} }

View File

@ -93,6 +93,7 @@ private:
unsigned m_fieldnum; // current step in multi-key sequence unsigned m_fieldnum; // current step in multi-key sequence
bool m_status_keydown; // current keydown status bool m_status_keydown; // current keydown status
bool m_last_cr; // was the last char a CR? bool m_last_cr; // was the last char a CR?
bool m_post_lf; // should we post LFs?
emu_timer * m_timer; // timer for posting characters emu_timer * m_timer; // timer for posting characters
attotime m_current_rate; // current rate for posting attotime m_current_rate; // current rate for posting
ioport_queue_chars_delegate m_queue_chars; // queue characters callback ioport_queue_chars_delegate m_queue_chars; // queue characters callback