1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

概要

wsl(wsl2じゃない)でnervesやってみる。
qemu(x86_64エミュレータ、ラズパイじゃない)でやってみた。
生成したnerves_livebook.imgを、QEMUで起動してテストしてみた。
GPIOが無いので、マウスを認識できる様にする。
InputEvent を使ってみる。

参考にしたページ

セットアップ

Mix.install([
	{:input_event, "~> 1.4.2"}
])

サンプルコード

InputEvent.enumerate()

実行結果

[
  {"/dev/input/event0",
   %InputEvent.Info{
     input_event_version: "1.0.1",
     name: "Power Button",
     bus: 25,
     vendor: 0,
     product: 1,
     version: 0,
     report_info: [ev_key: [:key_power]]
   }},
  {"/dev/input/event1",
   %InputEvent.Info{
     input_event_version: "1.0.1",
     name: "AT Translated Set 2 keyboard",
     bus: 17,
     vendor: 1,
     product: 1,
     version: 43841,
     report_info: [
       ev_rep: %{period: 33, delay: 250},
       ev_led: [:led_numl, :led_capsl, :led_scrolll],
       ev_msc: [:msc_scan],
       ev_key: [:key_esc, :key_1, :key_2, :key_3, :key_4, :key_5, :key_6, :key_7, :key_8, :key_9,
        :key_0, :key_minus, :key_equal, :key_backspace, :key_tab, :key_q, :key_w, :key_e, :key_r,
        :key_t, :key_y, :key_u, :key_i, :key_o, :key_p, :key_leftbrace, :key_rightbrace, :key_enter,
        :key_leftctrl, :key_a, :key_s, :key_d, :key_f, :key_g, :key_h, ...]
     ]
   }},
  {"/dev/input/event2",
   %InputEvent.Info{
     input_event_version: "1.0.1",
     name: "QEMU QEMU USB Mouse",
     bus: 3,
     vendor: 1575,
     product: 1,
     version: 1,
     report_info: [
       ev_msc: [:msc_scan],
       ev_rel: [:rel_x, :rel_y, :rel_wheel, 11],
       ev_key: [:btn_left, :btn_right, :btn_middle, :btn_side, :btn_extra]
     ]
   }},
  {"/dev/input/event3",
   %InputEvent.Info{
     input_event_version: "1.0.1",
     name: "ImExPS/2 Generic Explorer Mouse",
     bus: 17,
     vendor: 2,
     product: 6,
     version: 0,
     report_info: [
       ev_rel: [:rel_x, :rel_y, :rel_hwheel, :rel_wheel],
       ev_key: [:btn_left, :btn_right, :btn_middle, :btn_side, :btn_extra]
     ]
   }}
]

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?