<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 3, 2012, at 3:32 PM, Mark Cave-Ayland wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 30/11/12 21:57, Programmingkid wrote:<br><br><blockquote type="cite"><blockquote type="cite">Again - please take the get-key-map routine in arch/ppc/mol/methods.c as a starting point and make the *minimum* alterations for it to work under QEMU, and repost the patch. It should be just a case of changing the key detection functions, and so in that case I'd be happy to accept it as a patch.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">What advantage would this code have over mine?<br></blockquote><br>It's not an advantage per se, it's to do with maintainability. If the codebases are similar then any bugfixes to your code can be applied to the MOL code with relative ease (and while I'm not convinced people are still using it, I'd like to not break it if possible).<br><br><blockquote type="cite">A problem with this code is it was made for virtualization in mind. Qemu will be "emulating" a PowerMac. What this means is detecting the command key isn't possible with this code as is. My code already handles this situation.<br></blockquote><br>Are you sure about this? I'd be surprised if there wasn't already some kind of workaround in place. As mentioned before, OpenBIOS is designed to be able to run on real hardware with minimal modifications and so I'm not greatly keen to do this. </div></blockquote><br><div>On real hardware? I'm not too sure about that. This page seems to disagree as well: </div><div><font class="Apple-style-span" color="#333333" face="'Trebuchet MS', 'Lucida Grande', Verdana, Arial, sans-serif" size="4"><span class="Apple-style-span" style="line-height: 16px;"><a href="http://www.openfirmware.info/OpenBIOS">http://www.openfirmware.info/OpenBIOS</a></span></font></div><div><font class="Apple-style-span" color="#333333" face="'Trebuchet MS', 'Lucida Grande', Verdana, Arial, sans-serif" size="4"><span class="Apple-style-span" style="line-height: 16px;"><br></span></font></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 14px; line-height: 16px; ">"Do not try to put OpenBIOS in a real boot ROM, it will not work and may damage your hardware!"</span></div><br><blockquote type="cite"><div>Have you asked the developers on the qemu/qemu-ppc mailing lists how to emulate the command key on a non-Mac?<br></div></blockquote></div><br><div>No I haven't. All the PowerPC developers are busy making some target called P series. I really doubt they have the time or interest in emulating the command key. </div><div><br></div><div>I have looked at the code QEMU uses to handle key strokes and see no code that sends the command key to the emulated environment. The file itself is called cocoa.m.</div><div><br></div><div>Here is the code from cocoa.m that handles the keyboard:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> <span style="color: #bb23a0">case</span> NSKeyDown:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 133, 22); "><span style="color: #000000">            </span>// forward command Key Combos</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">            <span style="color: #bb23a0">if</span> ([event modifierFlags] & NSCommandKeyMask) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                [NSApp sendEvent:event];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                <span style="color: #bb23a0">return</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">            }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">            <span style="color: #008516">// default</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">            keycode = cocoa_keycode_to_qemu([event keyCode]);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 133, 22); "><span style="color: #000000">            </span>// handle control + alt Key Combos (ctrl+alt is reserved for QEMU)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">            <span style="color: #bb23a0">if</span> (([event modifierFlags] & NSControlKeyMask) && ([event modifierFlags] & NSAlternateKeyMask)) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                <span style="color: #bb23a0">switch</span> (keycode) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 133, 22); "><span style="color: #000000">                    </span>// enable graphic console</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                    <span style="color: #bb23a0">case</span> <span style="color: #3523d5">0x02</span> ... <span style="color: #3523d5">0x0a</span>: <span style="color: #008516">// '1' to '9' keys</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                        console_select(keycode - <span style="color: #3523d5">0x02</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                        <span style="color: #bb23a0">break</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">                }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">The line below "// forward command key combos" is what filters out the command key. I see no code to emulate the command key. </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div></div></body></html>