Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
drivers
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Liam Naddell
drivers
Commits
a294fe6d
Commit
a294fe6d
authored
Mar 20, 2017
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to support absolute mouse events
parent
66d2aa8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
19 deletions
+7
-19
vesad/src/scheme.rs
vesad/src/scheme.rs
+5
-1
vesad/src/screen/graphic.rs
vesad/src/screen/graphic.rs
+2
-18
No files found.
vesad/src/scheme.rs
View file @
a294fe6d
...
...
@@ -8,6 +8,8 @@ use display::Display;
use
screen
::{
Screen
,
GraphicScreen
,
TextScreen
};
pub
struct
DisplayScheme
{
width
:
usize
,
height
:
usize
,
active
:
usize
,
pub
screens
:
BTreeMap
<
usize
,
Box
<
Screen
>>
}
...
...
@@ -27,6 +29,8 @@ impl DisplayScheme {
}
DisplayScheme
{
width
:
width
,
height
:
height
,
active
:
1
,
screens
:
screens
}
...
...
@@ -88,7 +92,7 @@ impl SchemeMut for DisplayScheme {
fn
fpath
(
&
mut
self
,
id
:
usize
,
buf
:
&
mut
[
u8
])
->
Result
<
usize
>
{
let
path_str
=
if
id
==
0
{
format!
(
"display:input
"
)
format!
(
"display:input
/{}/{}"
,
self
.width
,
self
.height
)
}
else
if
let
Some
(
screen
)
=
self
.screens
.get
(
&
id
)
{
format!
(
"display:{}/{}/{}"
,
id
,
screen
.width
(),
screen
.height
())
}
else
{
...
...
vesad/src/screen/graphic.rs
View file @
a294fe6d
use
std
::
collections
::
VecDeque
;
use
std
::{
cmp
,
mem
,
slice
};
use
orbclient
::
{
Event
,
EventOption
}
;
use
orbclient
::
Event
;
use
syscall
::
error
::
*
;
use
syscall
::
flag
::{
SEEK_SET
,
SEEK_CUR
,
SEEK_END
};
...
...
@@ -12,8 +12,6 @@ use screen::Screen;
pub
struct
GraphicScreen
{
pub
display
:
Display
,
pub
seek
:
usize
,
pub
mouse_x
:
i32
,
pub
mouse_y
:
i32
,
pub
input
:
VecDeque
<
Event
>
,
pub
requested
:
usize
}
...
...
@@ -23,8 +21,6 @@ impl GraphicScreen {
GraphicScreen
{
display
:
display
,
seek
:
0
,
mouse_x
:
0
,
mouse_y
:
0
,
input
:
VecDeque
::
new
(),
requested
:
0
}
...
...
@@ -54,19 +50,7 @@ impl Screen for GraphicScreen {
}
fn
input
(
&
mut
self
,
event
:
&
Event
)
{
if
let
EventOption
::
Mouse
(
mut
mouse_event
)
=
event
.to_option
()
{
let
x
=
cmp
::
max
(
0
,
cmp
::
min
(
self
.display.width
as
i32
,
self
.mouse_x
+
mouse_event
.x
));
let
y
=
cmp
::
max
(
0
,
cmp
::
min
(
self
.display.height
as
i32
,
self
.mouse_y
+
mouse_event
.y
));
mouse_event
.x
=
x
;
self
.mouse_x
=
x
;
mouse_event
.y
=
y
;
self
.mouse_y
=
y
;
self
.input
.push_back
(
mouse_event
.to_event
());
}
else
{
self
.input
.push_back
(
*
event
);
}
self
.input
.push_back
(
*
event
);
}
fn
read
(
&
mut
self
,
buf
:
&
mut
[
u8
])
->
Result
<
usize
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment