Skip to content

Commit 95a2565

Browse files
0.1.0 release | basic usage
1 parent 63a2dbf commit 95a2565

File tree

4 files changed

+72
-27
lines changed

4 files changed

+72
-27
lines changed

BasicUsage.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Basic Usage
2+
1. Enable any required virtual devices via vJoy.
3+
2. Start rust-vjoy-manager.exe and prepare your config. Any changes are auto-live and may be visualized by the input viewer.
4+
3. Save config via System -> Save config.
5+
4. The most recently saved config will be auto-loaded on next start.
6+
7+
## Rebind types
8+
- Logical rebinds: don't modify or pipe any input, but prepare information/state which is used by reroute and virtual rebinds.
9+
- Reroute rebinds: pipe input from physical devices to virtual devices and may transform input (e.g. combine two buttons to one axis or apply axis offsets).
10+
- Virtual rebinds: act on the state of virtual devices exclusively.
11+
12+
## Execution order
13+
Rebinds are processed in the order of logical -> reroute -> virtual. Within one rebind type the order is top-to-bottom.
14+
15+
## Shift modes
16+
Shift modes can enable/disable rebinds and act as a bitmask.
17+
18+
`0b00000001` enables any rebind that requires the first bit to be set.
19+
20+
`0b00000000` disables any rebind that requires the first bit to be set.
21+
22+
`Active mode` is the required bitmask for a rebind to be considered active.
23+
24+
The current shift mode is found just below the `Virtual devices` label. Default mode: `0b00000001`.
25+
26+
## Adding/Removing rebinds
27+
Rebinds can be added via `Add logical/reroute/virtual` buttons at the top of the rebind list.
28+
29+
To remove/reorder a rebind, use the buttons next to the rebind.
30+
31+
## Input viewer
32+
Any rebinds in the loaded configuration are live. You can visualize the input for mutliple devices at the time by clicking the physical/virtual device in the devices list.
33+
34+
Tesselation/rendering of the input plots is quite CPU-intensive. You can minimize RVM to save resources and only process your rebinds without any rendering.
35+
36+
## Logs/Errors
37+
The terminal alongside the application will log information and errors - proper file logs are in the works.

src/graphics_backend/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ impl Graphics {
4141
};
4242

4343
vk_init_create_info.request_img_count = MAX_FRAMES_IN_FLIGHT as u32;
44-
vk_init_create_info.present_mode = PresentModeKHR::IMMEDIATE;
44+
vk_init_create_info.present_mode = if cfg!(feature = "profile") {
45+
PresentModeKHR::IMMEDIATE
46+
} else {
47+
PresentModeKHR::FIFO
48+
};
4549

4650
let vk_init = VkInit::new(
4751
Some(&window.raw_display_handle()),

src/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Manager {
6262
#[profiling::function]
6363
pub fn run(mut self, window: Window, event_loop: EventLoop<()>) -> ! {
6464
event_loop.run(move |new_event, _target, control_flow| {
65-
if window.inner_size().height == 0 || window.inner_size().height == 0 {
65+
if window.inner_size().width == 0 || window.inner_size().height == 0 {
6666
*control_flow = ControlFlow::WaitUntil(
6767
Instant::now().add(Duration::from_secs_f64(crate::input::INPUT_POLL_INTERVAL)),
6868
)

src/rebind/rebind_viewer.rs

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub(crate) fn build_ui(input: &mut Input, ui: &mut Ui, _ui_data: &mut UIData) {
208208
}
209209
});
210210
row.col(|ui| {
211-
if ui.button("Add logical").clicked() {
211+
if ui.button("Add reroute").clicked() {
212212
input.add_rebind(Rebind {
213213
name: "New reroute rebind".to_string(),
214214
mode_mask: ShiftModeMask::default(),
@@ -263,32 +263,36 @@ pub(crate) fn build_ui(input: &mut Input, ui: &mut Ui, _ui_data: &mut UIData) {
263263
ui.add_space(ui.available_height());
264264
});
265265

266-
let keep: Vec<bool> = active_rebinds_ui_wrapped.iter().map(|r| r.keep).collect();
267-
let copy: Vec<Rebind> = active_rebinds_ui_wrapped
268-
.iter()
269-
.filter_map(|r| match r.copy {
270-
false => None,
271-
true => Some(r.inner.clone()),
272-
})
273-
.collect();
274-
let index_mov: Vec<(usize, isize)> = active_rebinds_ui_wrapped
275-
.iter()
276-
.enumerate()
277-
.filter_map(|(index, r)| {
278-
if r.mov == 0 {
279-
None
280-
} else {
281-
Some((index, r.mov))
282-
}
283-
})
284-
.collect();
266+
{
267+
profiling::scope!("RebindViewer::build_ui::PostProcess");
268+
let keep: Vec<bool> =
269+
active_rebinds_ui_wrapped.iter().map(|r| r.keep).collect();
270+
let copy: Vec<Rebind> = active_rebinds_ui_wrapped
271+
.iter()
272+
.filter_map(|r| match r.copy {
273+
false => None,
274+
true => Some(r.inner.clone()),
275+
})
276+
.collect();
277+
let index_mov: Vec<(usize, isize)> = active_rebinds_ui_wrapped
278+
.iter()
279+
.enumerate()
280+
.filter_map(|(index, r)| {
281+
if r.mov == 0 {
282+
None
283+
} else {
284+
Some((index, r.mov))
285+
}
286+
})
287+
.collect();
285288

286-
input.remove_rebinds_from_keep(&keep);
287-
for (index, mov) in index_mov {
288-
input.move_rebind(index, mov);
289-
}
289+
input.remove_rebinds_from_keep(&keep);
290+
for (index, mov) in index_mov {
291+
input.move_rebind(index, mov);
292+
}
290293

291-
input.duplicate_rebinds_from_copy(copy);
294+
input.duplicate_rebinds_from_copy(copy);
295+
}
292296
});
293297
});
294298
});

0 commit comments

Comments
 (0)