Skip to content

Conversation

@simonjbeaumont
Copy link
Collaborator

Until now we have been defaulting the keymap to en-us but this
prevents VNC clients from using the QEMU ExtendedKeyEvent extension for
passing raw scan codes.

If a keymap is not passed to QEMU, it will default to using en-us
anyway but will enable the ExtendedKeyEvent extension.

This does not change the behaviour for when a keymap has actually been
specified. In this case, it is still honoured and passed to QEMU with
the -k option.

Signed-off-by: Si Beaumont simon.beaumont@citrix.com

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
@simonjbeaumont
Copy link
Collaborator Author

Depends on xapi-project/xen-api#2676

xc/device.ml Outdated
with _ -> None

let cmdline_of_disp info =
let combine_opts : bytes list option list -> bytes list = fun opts ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define a type synonym for bytes list to make this signature read a bit more easily. For example:

type params = bytes list
let cmdline_of_disp info =
   let combine_opts : params option list -> params = fun opts ->
   ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is moot if I do what you asked in #272 (diff)

let vnc_opt = Some ["-vnc"; ip_addr ^ ":" ^ port] in
let keymap_opt = Some ["-k"; keymap] in
combine_opts [unused_opt; vnc_opt; keymap_opt]
in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get the same effect without needing the combine_opts function:

let vnc_opts_of ip_addr_opt auto port keymap =
    let ip_addr = Opt.default "127.0.0.1" ip_addr_opt in
    let port = if auto then "1" else string_of_int port in
    let unused_opt = if auto then ["-vncunused"] else [] in
    let vnc_opt = ["-vnc"; ip_addr ^ ":" ^ port] in
    let keymap_opt = ["-k"; keymap] in
    List.flatten [unused_opt; vnc_opt; keymap_opt]

You should be able to make similar changes in other functions which are using combine_opts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll do this, and for the vga opts too.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Until now we have been defaulting the keymap to `en-us` but this
prevents VNC clients from using the QEMU ExtendedKeyEvent extension for
passing raw scan codes.

If a keymap is not passed to QEMU, it will default to using `en-us`
anyway but will enable the ExtendedKeyEvent extension.

This does not change the behaviour for when a keymap has actually been
specified. In this case, it is still honoured and passed to QEMU with
the `-k` option.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
@simonjbeaumont
Copy link
Collaborator Author

@euanh I think I've resolved all the style problems. Removing the "needs updating" and "reviewed" labels. Can you confirm you're happy (or otherwise)?

@euanh
Copy link
Collaborator

euanh commented Jun 17, 2016

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants