canvas-element-enum #3
|
|
@ -0,0 +1,2 @@
|
|||
Enrico Lumetti <enrico.lumetti (at) gmail (dot) com>
|
||||
Francesco Magliocca <franciman12 (at) gmail (dot) com>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
use input::{Libinput, LibinputInterface};
|
||||
use input::event::Event;
|
||||
use input::event::tablet_tool::{TabletToolEvent, TabletToolEventTrait};
|
||||
use std::time;
|
||||
use std::ffi::CString;
|
||||
use std::path::Path;
|
||||
use std::os::unix::io::{RawFd};
|
||||
|
|
@ -43,7 +44,7 @@ fn main() {
|
|||
while let Some(event) = libinput_ctx.next() {
|
||||
if let Event::Tablet(tablet_evt) = event {
|
||||
if let TabletToolEvent::Axis(axis_evt) = tablet_evt {
|
||||
if true { //axis_evt.pressure() > 1e-3 {
|
||||
if axis_evt.pressure() > 1e-3 {
|
||||
let pressure = axis_evt.pressure();
|
||||
let x_t = axis_evt.x_transformed(1080);
|
||||
let y_t = axis_evt.y_transformed(1920);
|
||||
|
|
|
|||
24
src/main.rs
24
src/main.rs
|
|
@ -1,18 +1,18 @@
|
|||
// Copyright 2019 The Druid Authors.
|
||||
// Stiletto
|
||||
// Copyright (C) 2020 Stiletto Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! An example of a custom drawing widget.
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::rc::Rc;
|
||||
use druid::im::{vector, Vector};
|
||||
|
|
|
|||
Loading…
Reference in New Issue