How to detect a newLine when there is only Carriage Return [13] without a LF aside
<p><strong>QUESTION EDITED</strong></p>

<p>In my Java program my barcode reader reads some characters into a TextBox.
This string ends with <code>[CR]</code> char. In my listener I get <code>KeyCode 77</code> <strong>M</strong> char for a <code>[CR]</code> but for <code>[LF]</code> I get <code>10</code> as expected.</p>

<p><strong>How can I handle a newline to trigger enter operation when I get only <code>[CR]</code> without a <code>[LF]</code> and what is this 77 (M) ?</strong></p>

<p>This is what I expect</p>

<p><a href="https://i.stack.imgur.com/IafmA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IafmA.png" alt="enter image description here"></a></p>

<p>This is what I get. <strong>CR</strong> is <strong>ASCII 13</strong> but I get <strong>77</strong> (M char)</p>

<p><a href="https://i.stack.imgur.com/4I3aZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4I3aZ.png" alt="enter image description here"></a></p>

<p>Normally in my barcode there is an actual M char and I don't want to handle 77 as enter.</p>

<p>My string ends with only <code>CR</code> but not <code>LF</code> . I think in Windows CR+LF makes a newline. My problem is without <code>LF</code> I can't handle <code>CR</code>. So I can't handle an <code>enter</code>. </p>

<p>Which component or listener should I use to handle just CR (decimal 13)? In a <code>.NET</code> app I can easily handle this<code>[CR]</code>.</p>

<p>Here is my listener</p>

<pre><code>textFieldSquareBarcode.addKeyListener(new java.awt.event.KeyAdapter() {

            @Override
            public void keyReleased(KeyEvent e) {   
               if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode()=='\r')
                DO(); //!!!!
             }
</code></pre>

<p>P.S. </p>

<p>CR is Carriage Return 13 decimal '\n' 0x0D hex</p>

<p>LF is Line Feed 10 decimal '\r' 0x0A hex</p>

<p><strong>EDIT:</strong>
As you see below '\r' and '\n' are recognized characters. But when barcode printer reads <code>[CR]</code> I can't see it in my keyListener event. Can you comment here if something is still unclear ?</p>

<pre><code>    char LF='\r';   
    char CR='\n';
    String whatINeed=CR+""+LF;
    String whatIhave=""+CR;
    String empty="";
    for (char c : whatINeed.toCharArray()) {
        System.out.println((int)c);
    }

output 
10
13
</code></pre>

<p><strong>EDIT 2:</strong></p>

<p>How it works on .Net Framework.</p>

<pre><code>    private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
        char c = e.KeyChar;
        textBox2.Text += $"{(int)c} | ({c}) {Environment.NewLine}";
        if ((int)c == 13)
            MessageBox.Show("Enter!!!");
    }
</code></pre>

<p>Now I'll try to print a <code>[CR]</code> character only barcode and diagnose this more accurately.</p>