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


All times are GMT. The time now is 11:15.

vBulletin® Version 3.8.8