<commit_before>package com.opera.core.systems.scope.services.ums;

import java.awt.Point;

import org.openqa.selenium.RenderedWebElement;

import com.opera.core.systems.QuickWidget;
import com.opera.core.systems.ScopeServices;
import com.opera.core.systems.scope.AbstractService;
import com.opera.core.systems.scope.ExecCommand;
import com.opera.core.systems.scope.SystemInputCommand;
import com.opera.core.systems.scope.internal.OperaMouseKeys;
import com.opera.core.systems.scope.protos.ExecProtos.MouseAction;
import com.opera.core.systems.scope.protos.SystemInputProtos.KeyPressInfo;
import com.opera.core.systems.scope.protos.SystemInputProtos.MouseInfo;
import com.opera.core.systems.scope.services.SystemInput;

public class SystemInputManager extends AbstractService implements SystemInput {

	 SystemInputManager(ScopeServices services, String version) {
			super(services, version);
			
			String serviceName = "system-input";
			
			if(!isVersionInRange(version, "5.0", serviceName))
				throw new UnsupportedOperationException(serviceName + " version " + version + " is not supported");
			
			services.setSystemInputManager(this);
		}
	
	public void click(Point location, int button, int num_clicks, int modifier) {
		MouseInfo.Builder actionBuilder = MouseInfo.newBuilder();
		actionBuilder.setX(location.x);
		actionBuilder.setY(location.y);
		actionBuilder.setButton(button); // MOUSE_BUTTON_1
		actionBuilder.setNumClicks(num_clicks);
		actionBuilder.setModifier(modifier);
		executeCommand(SystemInputCommand.CLICK, actionBuilder.clone());
	}

	public void keyPress(String key, int modifier) {
		KeyPressInfo.Builder actionBuilder = KeyPressInfo.newBuilder();
		actionBuilder.setKey(key);
		actionBuilder.setModifier(modifier);
		executeCommand(SystemInputCommand.KEYPRESS, actionBuilder.clone());
	}

}<commit_msg>Added more mouse commands to SystemInput<commit_after>package com.opera.core.systems.scope.services.ums;

import java.awt.Point;

import org.openqa.selenium.RenderedWebElement;

import com.opera.core.systems.QuickWidget;
import com.opera.core.systems.ScopeServices;
import com.opera.core.systems.scope.AbstractService;
import com.opera.core.systems.scope.ExecCommand;
import com.opera.core.systems.scope.SystemInputCommand;
import com.opera.core.systems.scope.internal.OperaMouseKeys;
import com.opera.core.systems.scope.protos.ExecProtos.MouseAction;
import com.opera.core.systems.scope.protos.SystemInputProtos.KeyPressInfo;
import com.opera.core.systems.scope.protos.SystemInputProtos.MouseInfo;
import com.opera.core.systems.scope.services.SystemInput;
import com.opera.core.systems.scope.internal.OperaKeys;

public class SystemInputManager extends AbstractService implements SystemInput {

	 SystemInputManager(ScopeServices services, String version) {
			super(services, version);
			
			String serviceName = "system-input";
			
			if(!isVersionInRange(version, "5.0", serviceName))
				throw new UnsupportedOperationException(serviceName + " version " + version + " is not supported");
			
			services.setSystemInputManager(this);
		}
	
	public void click(Point location, int button, int num_clicks, int modifier) {
		MouseInfo.Builder actionBuilder = MouseInfo.newBuilder();
		actionBuilder.setX(location.x);
		actionBuilder.setY(location.y);
		actionBuilder.setButton(button); // MOUSE_BUTTON_1
		actionBuilder.setNumClicks(num_clicks);
		actionBuilder.setModifier(modifier);
		executeCommand(SystemInputCommand.CLICK, actionBuilder.clone());
	}
	
	public void mouseMove(Point location, int button, int modifier) {
		MouseInfo.Builder actionBuilder = MouseInfo.newBuilder();
		actionBuilder.setX(location.x);
		actionBuilder.setButton(button); 
		actionBuilder.setNumClicks(1); // NOT RELEVANT- SHOULD BE OPTIONAL?
		actionBuilder.setModifier(modifier);
		executeCommand(SystemInputCommand.MOUSEMOVE, actionBuilder.clone());
	}
	
	public void mouseUp(Point location, int button, int modifier) {
		MouseInfo.Builder actionBuilder = MouseInfo.newBuilder();
		actionBuilder.setX(location.x);
		actionBuilder.setButton(button); 
		actionBuilder.setNumClicks(1); // NOT RELEVANT - SHOULD BE OPTIONAL?
		actionBuilder.setModifier(modifier);
		executeCommand(SystemInputCommand.MOUSEUP, actionBuilder.clone());
	}

	public void mouseDown(Point location, int button, int modifier) {
		MouseInfo.Builder actionBuilder = MouseInfo.newBuilder();
		actionBuilder.setX(location.x);
		actionBuilder.setButton(button); 
		actionBuilder.setNumClicks(1); // NOT RELEVANT - SHOULD BE OPTIONAL?
		actionBuilder.setModifier(modifier);
		executeCommand(SystemInputCommand.MOUSEDOWN, actionBuilder.clone());
	}
	
	public void keyPress(String key, int modifier) {
		String myKey = OperaKeys.get(key);
		System.out.println("myKey = " + myKey);
		KeyPressInfo.Builder actionBuilder = KeyPressInfo.newBuilder();
		actionBuilder.setKey(key);
		actionBuilder.setModifier(modifier);
		executeCommand(SystemInputCommand.KEYPRESS, actionBuilder.clone());
	}
	
}
{'fraction_non_alphanumeric': 0.10737985119646089, 'fraction_numerical': 0.0018097727729740598, 'mean_word_length': 5.908333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '259329', 'n_tokens_mistral': 1620, 'n_tokens_neox': 1487, 'n_words': 254}