alkaid-benetnash / emubthid Goto Github PK
View Code? Open in Web Editor NEWEmulate a Bluetooth HID device with bluez on linux
Emulate a Bluetooth HID device with bluez on linux
How did you figure out all the mapping and the keyboard and mouse state bytearrays? im asking this as im trying to do something similar with an xbox360 controller
I followed the instruction, and I can see the window with "grab" message, but as soon as I press a key, it will have the following error message. Do you have any clue?
Registered
waiting for connection
Control channel connected to 00:8A:76:80:4A:F1
Interrupt channel connected to 00:8A:76:80:4A:F1
Exposed : 1
Exit
Traceback (most recent call last):
File "/home/jiang/code/EmuBTHID/main.py", line 233, in <module>
Window(d).loop(bthid_srv.send)
File "/home/jiang/code/EmuBTHID/main.py", line 141, in loop
send_call_back(bytes(kbd_state))
File "/home/jiang/code/EmuBTHID/BluetoothHID.py", line 85, in send
self.cinter.send(bytes_buf)
Connection Reset by Peer.
Hey buddy, thanks for the project. I'm trying to run this on Arch Linux, and pair to it from another Arch Linux computer, or an Android phone, but it doesn't show up as discoverable. Are there special steps besides running main.py
as root?
This is great! Thank you for making this. It is so close to what I need. However...
Is there something I need to do to get mouse data to pass to the phone continuously?
any idea?
I am using Ubuntu 22.04. BlueZ is native installed. When I run 'sudo bluetoothd -P input', it shows ''D-Bus setup failed: Name already in use'. And then running 'sudo python3 main.py' resulted in 'Address already in use'.
How should I resolve this failure?
Thanks.
I think this is an awesome bit of code. It's saved me from purchasing another keyboard for my windows Desktop machine, meaning I don't have to get used to 2 different keyboard layouts.
I've tested this on both a Windows desktop machine and my Samsung Galaxy phone, both work flawlessly.
I would like to contribute to the repo. I think the goal would be to minify the setup to a single python file / bash script that can be used to pair and connect and emulate the keyboard. Do you know how to get started with this / limitations?
It's a fantastic project and we need an open source keyboard emulator for linux, I can't find any other decent free software to do this.
- make sure bluetoothd has plugin input enabled ("-P input")
" -P, --noplugin=NAME,... Specify plugins not to load"
If the plugin is enabled (as is by default), I get "Address already in use" (it would be helpful if the program caught this error and reminded about input plugin).
Hi!
I'm trying to use your software to emulate a BT HID, but I'm getting this error:
File "main.py", line 223, in <module> d = display.Display() File "/usr/lib/python3/dist-packages/Xlib/display.py", line 80, in __init__ self.display = _BaseDisplay(display) File "/usr/lib/python3/dist-packages/Xlib/display.py", line 62, in __init__ display.Display.__init__(*(self, ) + args, **keys) File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 53, in __init__ name, host, displayno, screenno = connect.get_display(display) File "/usr/lib/python3/dist-packages/Xlib/support/connect.py", line 64, in get_display return getattr(mod, modname).get_display(display) File "/usr/lib/python3/dist-packages/Xlib/support/unix_connect.py", line 58, in get_display raise error.DisplayNameError(display) Xlib.error.DisplayNameError: Bad display name ""
Do you know I can I solve it?
Thanks!
Hi, thanks for great source code.
as i know we can move cursor to new location by changing X and Y when e.type == X.MotionNotify
mouse_state = bytearray([
0xA1,
0x02, # Report ID
0x00, # mouse button, in this byte XXXXX(button2)(button1)(button0)
0x00, # X displacement
0x00, # Y displacement
])
where x_coord = old_x_coord + X
and y_coord = old_y_coord + Y
on client device.
How to move cursor to exact coordinates when server doesn't know current cursor coordinates?
input disabled (i.e. "-P input")
https://github.com/Alkaid-Benetnash/EmuBTHID#enable-bluetooth
I want to add the commands...
sudo systemctl edit bluetooth
### Editing /etc/systemd/system/bluetooth.service.d/override.conf
### Anything between here and the comment below will become the contents >
[Service]
ExecStart=
ExecStart=/usr/lib/bluetooth/bluetoothd -P input
sudo systemctl restart bluetooth
Followed all instructions, no window pops up, my phone cannot detect anything even though discoverable was turned on
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.