Thread: Fix mouse clicking in java 9

Page 5 of 8 FirstFirst ... 34567 ... LastLast
Results 41 to 50 of 71
  1. #41 Right clicking issues 
    Registered Member
    Join Date
    Oct 2012
    Posts
    5
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I spent a few hours trying to get this to work,no luck. But that doesn't say much because I'm a new coder. I am having issues with a finding symbols. I normally don't post for help, but i can't figure this out.
    Reply With Quote  
     

  2. #42  
    Super Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    660
    Thanks given
    82
    Thanks received
    255
    Rep Power
    592
    Quote Originally Posted by Toxicnation View Post
    I spent a few hours trying to get this to work,no luck. But that doesn't say much because I'm a new coder. I am having issues with a finding symbols. I normally don't post for help, but i can't figure this out.
    Let's resolve that
    Could u upload both ur original RSApplet and the RSApplet post ur attempt at implementing this snippet? (https://pastebin.com)
    Reply With Quote  
     

  3. #43  
    Registered Member
    Join Date
    Oct 2012
    Posts
    5
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by StanDev View Post
    Let's resolve that
    Could u upload both ur original RSApplet and the RSApplet post ur attempt at implementing this snippet? (https://pastebin.com)
    Posted!

    New- https://pastebin.com/NCj6jyG6

    Old- https://pastebin.com/zCK5MubK
    Reply With Quote  
     

  4. #44  
    Super Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    660
    Thanks given
    82
    Thanks received
    255
    Rep Power
    592
    Quote Originally Posted by Toxicnation View Post
    It seems like you're missing the required import, add this one and u should be fine:
    Code:
    import javax.swing.SwingUtilities;
    I recommend u try to get used to an IDE, it will notify you of these kind of issues and offer solutions when directly available (https://www.jetbrains.com/idea/download/)
    Reply With Quote  
     

  5. #45  
    Registered Member
    Join Date
    Oct 2012
    Posts
    5
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by StanDev View Post
    It seems like you're missing the required import, add this one and u should be fine:
    Code:
    import javax.swing.SwingUtilities;
    I recommend u try to get used to an IDE, it will notify you of these kind of issues and offer solutions when directly available (https://www.jetbrains.com/idea/download/)
    Wow thank you so much! Fixed!
    Reply With Quote  
     

  6. #46  
    Super Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    660
    Thanks given
    82
    Thanks received
    255
    Rep Power
    592
    Quote Originally Posted by Toxicnation View Post
    Wow thank you so much! Fixed!
    My pleasure man
    Reply With Quote  
     

  7. #47  
    Website Developer

    ruby.exe's Avatar
    Join Date
    Mar 2018
    Posts
    98
    Thanks given
    1,000
    Thanks received
    202
    Rep Power
    428
    yes yes yes
    Attached image


    Syntax is easy. Math is hard.
    Reply With Quote  
     

  8. #48  
    Registered Member
    Flub's Avatar
    Join Date
    Apr 2017
    Posts
    167
    Thanks given
    11
    Thanks received
    32
    Rep Power
    103
    You are an absolute LEGEND!!!
    Reply With Quote  
     

  9. #49  
    Banned

    Join Date
    Dec 2019
    Age
    31
    Posts
    376
    Thanks given
    361
    Thanks received
    214
    Rep Power
    0
    Quote Originally Posted by StanDev View Post
    Java 9 introduced a few bugs in the ancient client engine most people use, the most noticeable one is right mouse clicking.

    Go to the class where you handle your mouse clicking, usually in RSApplet.java.

    Search for this:
    Code:
     
    if (type == 2) {
    			mouseWheelDown = true;
    			mouseWheelX = i;
    			mouseWheelY = j;
    			return;
    		}
    replace the if statement with:
    Code:
    if (SwingUtilities.isMiddleMouseButton(e)) {
    Note that the argument of the method (e) is the MouseEvent object reference, this might be named differently in your client.

    Then search for:
    Code:
    		if (mouseevent.isMetaDown()) {
    			clickMode1 = 2;
    			clickMode2 = 2;
    		}
    Replace the first if statement with:
    Code:
    	if(SwingUtilities.isRightMouseButton(e)) {
    Then also in the following else block:
    Code:
    	} else {
    			clickMode1 = 1;
    			clickMode2 = 1;
    		}
    replace the else line with:
    Code:
    	} else if(SwingUtilities.isLeftMouseButton(e)){
    As pointed out by Jire, it is better to do it this way:
    I'm simply bumping this thread as someone i was helping, had this issue and this fixed it. Thanks man for the post
    Reply With Quote  
     

  10. #50  
    Misthalin where it all began.
    Forzaiken's Avatar
    Join Date
    Dec 2019
    Posts
    60
    Thanks given
    1
    Thanks received
    17
    Rep Power
    12
    hi i was wondering if someone could help me out with this I know am new to this, but tried to follow this. but somethings i really could not find. I have to state I currently use the dawntained (released version on rune-server) https://pastebin.com/xLhd5zDV current un-edited RSApplet.java

    this is what i could not find nor something that looked similare
    Code:
     
    if (type == 2) {
    			mouseWheelDown = true;
    			mouseWheelX = i;
    			mouseWheelY = j;
    			return;
    		}
    here is the new code. Also where can I find the letter (SwingUtilities.isRightMouseButton(e)) in this case the e that my client uses so i can change that.
    Code:
            public final void mousePressed(MouseEvent mouseevent)
            {
                    int i = mouseevent.getX();
                    int j = mouseevent.getY();
                    if (gameFrame != null)
                    {
                            i -= 4; //4
                            j -= 22; //22
                    }
                    idleTime = 0;
                    clickX = i;
                    clickY = j;
                    clickTime = System.currentTimeMillis();
                    
                	if(SwingUtilities.isRightMouseButton(e)) {                {
                            clickMode1 = 2;
                            clickMode2 = 2;
    
                	} else if(SwingUtilities.isLeftMouseButton(e)){
                    {
                            clickMode1 = 1;
                            clickMode2 = 1;
                    }
            }
    old code.

    Code:
                    if (mouseevent.isMetaDown())
                    {
                            clickMode1 = 2;
                            clickMode2 = 2;
                    }
                    else
                    {
                            clickMode1 = 1;
                            clickMode2 = 1;
                    }
            }
    Quote Originally Posted by Corey View Post
    Already helped him fix on another thread.
    can you please help me out with this?
    Reply With Quote  
     

Page 5 of 8 FirstFirst ... 34567 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [667/7**] How to fix right click bug in PvP
    By Zach in forum Tutorials
    Replies: 5
    Last Post: 06-30-2014, 05:06 PM
  2. Fix another bug in pickuping! + Video
    By Pkitten in forum Tutorials
    Replies: 59
    Last Post: 05-27-2008, 12:17 PM
  3. PKScapeX is recruiting a MySQL in Java developer
    By Stanyer in forum RS2 Server
    Replies: 7
    Last Post: 01-09-2008, 02:22 AM
  4. How to Make objects give you in item when you click in them!
    By black-pure-4-lyfe in forum Tutorials
    Replies: 3
    Last Post: 08-28-2007, 09:35 AM
  5. Fixing Logout Glitch in WhiteScape
    By Santa Noobie in forum Tutorials
    Replies: 2
    Last Post: 05-29-2007, 10:58 PM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •