maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [APP] Right-clicking function like in VNCViewer [clickhack1_F6] (https://talk.maemo.org/showthread.php?t=30537)

t_moyashi 2009-07-28 16:36

[APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
1 Attachment(s)
This simple app enable you to use Right-clicking function like VNCViewer's in anywhere
Right-clicking has been achieved by a long tap.(libgtkstylus.so)
It works well ,but I wanted the function like VNCViewer(in Maemo)'s.
so , I made this app.
While you hold down the FullScreenKey(F6) , your taps become Right-clicks.(you can even drag)
I attached a SCShot of using this app in easy-debian(qvwm).
also, it will work in maemo(ie:KDE.or Ooo).
It may work in mer.

6 steps for testing :
1.download <clickhack1b_F6.tar.gz>
2.open the terminal you like(ie: osso-Xterm)
3.install <xmodmap> from appmanager or "apt-get install xmodmap" as root.
4.unpack "tar xvzf /your/download/dir/clickhack1b_F6.tar.gz"
(ie:tar xvzf /user/home/MyDocs/clickhack1b_F6.tar.gz)
5.run it "/your/download/dir/clickhack1b_F6/clickhack_F6"
(ie:/user/home/MyDocs/clickhack1b_F6/clickhack_F6)
6.if you want to stop using it, just press [Ctrl+C] or run "killall clickhack_F6" in another terminal

>if you want to run it automatically
1.run "mv clickhack1b_F6/clickhack_F6 /yourdebianroot/usr/local/bin/"
2.add "/usr/local/bin/clickhack_F6 &" to startup script (ie : .xinitrc).
3.to be free from longtap function , run "export $GTK_MODULES=''"

Do you think I reinvented the wheel ?

clickhack1b_F6.tar.gz includes :
clickhack1b_F6/
clickhack1b_F6/clickhack1b.c #dirty source code
clickhack1b_F6/clickhack_F6 #main program

Update :
Update1: (10-04-09) clickhack1b: some bugs were fixed(?).

debernardis 2009-07-28 17:53

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Unfortunately doesn't work on my tablet, maybe because I run a previous OS (Chinook)?.

qwerty12 2009-07-28 18:01

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
You need xmodmap installed and it also has to be ran as root.

magic_doc 2009-09-03 08:27

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by qwerty12 (Post 307283)
You need xmodmap installed and it also has to be ran as root.

Thanks to t_moyashi for the great job, in order to start the binary automatically at boottime I created this script as /etc/rc2.d/S99clickhack:

Code:

#!/bin/sh

export DISPLAY=:0.0
/usr/local/bin/clickhack_F6 &

Don't forget to make it executable!

The important thing is the export of the DISPLAY-Variable, because otherwise, the program is running in background but it has no effect actually... :mad:

jaem 2009-09-05 01:52

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Maybe I'm missing something, but this didn't work for me. I downloaded xmodmap from the Lancode.de repository, then followed the instructions in this thread, and while it changed something, it definitely didn't enable right-click. Some widgets wouldn't respond (which they would to a normal left-click), but widgets that had, say, a context menu, behaved like I'd just left-clicked them normally, rather than displaying the menu. (e.g. links in Tear)
Is there something I'm missing? I exported DISPLAY properly, and ran it as root.

Also, is this supposed to disable F6's fullscreen functionality? I didn't see anything explicit in the source to do that, but I've never played around with this sort of stuff. If not, is there a way to do that?

magic_doc 2009-09-05 17:02

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by jaem (Post 321862)
Maybe I'm missing something, but this didn't work for me. I downloaded xmodmap from the Lancode.de repository, then followed the instructions in this thread, and while it changed something, it definitely didn't enable right-click. Some widgets wouldn't respond (which they would to a normal left-click), but widgets that had, say, a context menu, behaved like I'd just left-clicked them normally, rather than displaying the menu. (e.g. links in Tear)
Is there something I'm missing? I exported DISPLAY properly, and ran it as root.

ok, I understand- you know that you must hold down the fullscreen button while clicking to achieve a rigth-click?
If it still doesn't work please try this:
Open a terminal and enter:
Code:

xmodmap -pp
You should get an output like this:
Code:

talakara:~# xmodmap -pp
There are 32 pointer buttons defined.

    Physical        Button
    Button          Code
        1              1
        2              2
        3              3
        ...

Then hold down the fullscreen-button while repeating the procedure. The result must be this:

Code:

talakara:~# xmodmap -pp
There are 32 pointer buttons defined.

    Physical        Button
    Button          Code
        1              3
        2              2
        3              1
        ...

This means that the button-code 3 (right click) is on the left button now.
If this doesn't work you can try it with this command:

Code:

xmodmap -e "pointer = 3 2 1"
This change is permanent then, you will always have a right mouseclick!

To undo this just turn it around:

Code:

xmodmap -e "pointer = 1 2 3"
So you can determine if the xmodmap or the clickhack doesn't work properly.

Quote:

Also, is this supposed to disable F6's fullscreen functionality? I didn't see anything explicit in the source to do that, but I've never played around with this sort of stuff. If not, is there a way to do that?
For me, both functions are working: maemo-apps can be switched to fullscreen when I press the button shortly, when I hold it down I have a right-mouseclick for the gtk-apps.
I must admit that sometimes the right-click stays and I see the behavior you described above. To solve this I just press and release the button one time and everything works again.

HTH & Good luck!

CU Doc

jaem 2009-09-07 04:38

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Thanks, but I'd already tried that, and everything checks out. To clarify, does this only work in non-hildonized GTK or Qt apps? On further investigation, it works correctly in the GConf editor app, but not in any other program I have installed, that I've tried so far. Maybe I'm just misunderstanding something.

magic_doc 2009-09-07 20:30

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by jaem (Post 322976)
Thanks, but I'd already tried that, and everything checks out. To clarify, does this only work in non-hildonized GTK or Qt apps? On further investigation, it works correctly in the GConf editor app, but not in any other program I have installed, that I've tried so far. Maybe I'm just misunderstanding something.

Can you tell me an application where it doesn't work?
For me I am using pidgin (not the maemo but the debian-package) and kdepimpi and in both apps the right-click works.

CU Doc

jaem 2009-09-08 06:48

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Off the top of my head, Tear, Maemo RSS Reader, microB (I think)... I tried a whole bunch of apps, but not systematically.

magic_doc 2009-09-08 20:01

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by jaem (Post 323563)
Off the top of my head, Tear, Maemo RSS Reader, microB (I think)... I tried a whole bunch of apps, but not systematically.

Okay, I don't know Tear, I suppose Maemo RSS Reader is the pre-installed one and microB is the standard browser.
For the latter take a look at this:
http://tech.arantius.com/maemo-brows...ec-midori-tear
There you can see that the right-click is relized by holding down the stylus- I think that is the default behavoir with hildon-apps.
Propably there is really a misunderstanding: you search for a right-click-function supported by click_hack where there is none ;)

CU Doc

jaem 2009-09-19 07:16

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

3.to be free from longtap function , run "export $GTK_MODULES=''"
This gave me the impression that clickhack would work as an alternate method of right-click for Hildon apps. Is that incorrect?

linuxeventually 2009-09-19 13:13

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
I just got around to testing this out. And when I hit the Full-screen key. It's like a toggle. I'm not sure if it's related to the default toggle fullscreen behavior or not. But if it's toggled on, certain parts of the touchscreen don't work correctly and buttons are only highlighted not pressed. Which was weird at first, as afraid the touchscreen was dying. But then x11forwarded into my desktop and taps in gedit were right-clicks, it was then that I realized it might be toggled on. Pressed full-screen key. Left clicks work in OS2008 and elsewhere, w00t. Thanks a lot for this.

magic_doc 2009-09-24 08:08

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by linuxeventually (Post 329815)
I just got around to testing this out. And when I hit the Full-screen key. It's like a toggle. I'm not sure if it's related to the default toggle fullscreen behavior or not. But if it's toggled on, certain parts of the touchscreen don't work correctly and buttons are only highlighted not pressed. Which was weird at first, as afraid the touchscreen was dying. But then x11forwarded into my desktop and taps in gedit were right-clicks, it was then that I realized it might be toggled on. Pressed full-screen key. Left clicks work in OS2008 and elsewhere, w00t. Thanks a lot for this.

I noticed that behavoir too, but not always. I do not really fully understand why the clickhack "hangs" sometimes.
The normal way to use it should be to hold down the button (which has no effect in non-hildonized apps) and the trigger a right-click when touching the screen.
When released it should be a left click again.
Workarround is to kill the clickhack-process, sometimes I managed to reset it with numberous press and releases of the fullscreen button.
Sorry that I can't be more precise, but I use this function not that often.
Maybe the author can give some hints for further investigations?

magic_doc 2009-09-24 08:10

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by jaem (Post 329699)
This gave me the impression that clickhack would work as an alternate method of right-click for Hildon apps. Is that incorrect?

No, in hildonized apps you achieve a rigth-click always with a long tap on the screen- clickhack is for apps where this doesn't work- that's the way I understood it.

t_moyashi 2009-10-03 16:55

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by magic_doc (Post 332740)
No, in hildonized apps you achieve a rigth-click always with a long tap on the screen- clickhack is for apps where this doesn't work- that's the way I understood it.

yeah.
I didn't write it for the Hildon environment but for KDE or other WindowManagers(in deblet ,easy debian/ubuntu etc.).
I should have made this point clear at the first post...
<fixed>BTW, I found some bugs that might provoke reported errors.
I'll upload the new version of this app in 2-3 days.
</fixed>
Thanks testers.

magic_doc 2009-10-03 17:00

Re: [APP] Right-clicking function like in VNCViewer [clickhack1_F6]
 
Quote:

Originally Posted by t_moyashi (Post 338814)
yeah.
I didn't write it for the Hildon environment but for KDE or other WindowManagers(in deblet ,easy debian/ubuntu etc.).
I should have made this point clear at the first post...

BTW, I found some bugs that might provoke reported errors.
I'll upload the new version of this app in 2-3 days.
Thanks testers.

Thank you for the useful app! Would you please publish this here when it is available? Have a nice weekend.

UPDATE: Just installed your new binary, I will test ist and report in here... Thanks again!

CU Michael


All times are GMT. The time now is 07:09.

vBulletin® Version 3.8.8