本文整理汇总了Java中net.rim.device.api.system.Characters类的典型用法代码示例。如果您正苦于以下问题:Java Characters类的具体用法?Java Characters怎么用?Java Characters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Characters类属于net.rim.device.api.system包,在下文中一共展示了Characters类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyControl
import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyControl(char c, int status, int time) {
if(c == Characters.CONTROL_VOLUME_UP || c == Characters.CONTROL_VOLUME_DOWN) {
int i = MMAPIPlayer.getGlobalVolume();
if(i == -1) {
i = 70;
}
if(c == Characters.CONTROL_VOLUME_UP) {
MMAPIPlayer.setGlobalVolume(Math.min(100, i + 4));
} else {
MMAPIPlayer.setGlobalVolume(Math.max(0, i - 4));
}
if(BlackBerryImplementation.getVolumeListener() != null) {
BlackBerryImplementation.getVolumeListener().fireActionEvent(new ActionEvent(this, c));
return true;
}
}
return super.keyControl(c, status, time);
}
示例2: keyControl
import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyControl(char c, int status, int time) {
if (c == Characters.CONTROL_VOLUME_UP) {
AudioPlayer.instance.incVolume();
return true;
} else if (c == Characters.CONTROL_VOLUME_DOWN) {
AudioPlayer.instance.decVolume();
return true;
} else {
return super.keyControl(c, status, time);
}
}
示例3: keyChar
import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyChar(char character, int status, int time) {
if (character == Characters.ENTER) {
raiseClick();
return true;
}
return super.keyChar(character, status, time);
}
示例4: keyDown
import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyDown(int keycode, int time) {
if (Keypad.map(Keypad.key(keycode), Keypad.status(keycode)) == Characters.ENTER) {
isActive = true;
invalidate();
}
return super.keyDown(keycode, time);
}
示例5: keyUp
import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyUp(int keycode, int time) {
if (Keypad.map(Keypad.key(keycode), Keypad.status(keycode)) == Characters.ENTER) {
isActive = false;
invalidate();
return true;
}
return super.keyUp(keycode, time);
}
示例6: keyChar
import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyChar(char character, int status, int time) {
if (character == Characters.ENTER) {
boolean ret = super.keyChar(character, status, time);
if (!ret) {
raiseClick();
}
return true;
}
return super.keyChar(character, status, time);
}
示例7: captureVideo
import net.rim.device.api.system.Characters; //导入依赖的package包/类
public void captureVideo(ActionListener response) {
captureCallback = new EventDispatcher();
captureCallback.addListener(response);
UiApplication.getUiApplication().addFileSystemJournalListener(new FileSystemJournalListener() {
private long lastUSN;
private String videoPath;
public void fileJournalChanged() {
// next sequence number file system will use
long USN = FileSystemJournal.getNextUSN();
for (long i = USN - 1; i >= lastUSN && i < USN; --i) {
FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);
if (entry == null) {
break;
}
String path = entry.getPath();
if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED
&& videoPath == null) {
int index = path.indexOf(".3GP");
if (index != -1) {
videoPath = path;
}
} else if (entry.getEvent() == FileSystemJournalEntry.FILE_RENAMED) {
if (path != null && path.equals(videoPath)) {
//close the camera
UiApplication.getUiApplication().removeFileSystemJournalListener(this);
try {
EventInjector.KeyEvent inject = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0, 200);
inject.post();
inject.post();
} catch (Exception e) {
//try to close the camera
}
captureCallback.fireActionEvent(new ActionEvent("file://" + path));
captureCallback = null;
videoPath = null;
break;
}
}
}
lastUSN = USN;
}
});
app.setWaitingForReply(true);
synchronized (UiApplication.getEventLock()) {
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments(CameraArguments.ARG_VIDEO_RECORDER));
}
}